public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Ma Xinjian <maxj.fnst@fujitsu.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] posix/conformance/interfaces/sem_timedwait/2-1: Remove MAP_ANONYMOUS
Date: Mon, 23 Sep 2024 14:54:44 +0200	[thread overview]
Message-ID: <ZvFlFEA52rQWQYP0@yuki.lan> (raw)
In-Reply-To: <20240919032729.458711-1-maxj.fnst@fujitsu.com>

Hi!
Pushed with two minor changes, thanks.

- POSIX requires that the SHM_NAME starts with /
- Made use of ERROR_PREFIX

Full diff:
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-1.c
index b1747f01d..d9012cc5e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-1.c
@@ -24,7 +24,7 @@
 #include "posixtest.h"
 
 #define TEST "2-1"
-#define SHM_NAME "posixtest_2-1"
+#define SHM_NAME "/posixtest_2-1"
 #define FUNCTION "sem_timedwait"
 #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": "
 
@@ -36,17 +36,17 @@ int main(void)
 
        fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
        if (fd == -1) {
-               perror("An error occurs when calling shm_open()");
+               perror(ERROR_PREFIX "shm_open()");
                return PTS_UNRESOLVED;
        }
 
        if (ftruncate(fd, sizeof(*mysemp)) == -1) {
-               perror("An error occurs when calling ftruncate()");
+               perror(ERROR_PREFIX "ftruncate()");
                return PTS_UNRESOLVED;
        }
 
        if (shm_unlink(SHM_NAME) != 0) {
-               perror("An error occurs when calling shm_unlink()");
+               perror(ERROR_PREFIX "shm_unlink()");
                return PTS_UNRESOLVED;
        }


-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      reply	other threads:[~2024-09-23 12:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-19  3:27 [LTP] [PATCH v2] posix/conformance/interfaces/sem_timedwait/2-1: Remove MAP_ANONYMOUS Ma Xinjian via ltp
2024-09-23 12:54 ` Cyril Hrubis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZvFlFEA52rQWQYP0@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=maxj.fnst@fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox