From: Dmitry V. Levin Date: Sat, 23 Apr 2016 01:53:43 +0000 (+0000) Subject: tests/shmxt.c: robustify against arch specific issues X-Git-Tag: v4.12~296 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6c69ed7ac54b7a7570227f3691d25e53e8318d19;p=strace tests/shmxt.c: robustify against arch specific issues Do not treat failed shmat(SHM_RND) as a test failure. This change partially reverts commit bea707377d2ee3e1950bfa43537ef928163a5fa6. * tests/shmxt.c (main): Use SHM_RND in the second shmat call, do not treat its potential error as a test failure. --- diff --git a/tests/shmxt.c b/tests/shmxt.c index fdfa6d7f..8e087f3c 100644 --- a/tests/shmxt.c +++ b/tests/shmxt.c @@ -39,11 +39,14 @@ main(void) perror_msg_and_skip("shmdt"); printf("shmdt(%p) = 0\n", shmaddr); - void *shmaddr2 = shmat(id, shmaddr, 0); + ++shmaddr; + void *shmaddr2 = shmat(id, shmaddr, SHM_RND); if (shmaddr2 == (void *)(-1)) - perror_msg_and_skip("shmat %p", shmaddr); - printf("%s(%d, %p, 0) = %p\n", - SHMAT, id, shmaddr, shmaddr2); + printf("%s(%d, %p, SHM_RND) = -1 %s (%m)\n", + SHMAT, id, shmaddr, errno2name()); + else + printf("%s(%d, %p, SHM_RND) = %p\n", + SHMAT, id, shmaddr, shmaddr2); puts("+++ exited with 0 +++"); return 0;