From c84536f975f5b8bbd390d917cee1dfe7e40b9f46 Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Mon, 28 Nov 2016 22:12:12 +0300 Subject: [PATCH] print_sigevent: fix field names of sigev_value structure * print_sigevent.c (print_sigevent): Change "int" to "sival_int", "ptr" to "sival_ptr". * tests/mq_sendrecv.c (main): Update expected output in accordance with fixed field names. * tests/timer_create.c (main): Likewise. --- print_sigevent.c | 2 +- tests/mq_sendrecv.c | 8 ++++---- tests/timer_create.c | 27 ++++++++++++++------------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/print_sigevent.c b/print_sigevent.c index caf1fdfe..da912ba3 100644 --- a/print_sigevent.c +++ b/print_sigevent.c @@ -44,7 +44,7 @@ MPERS_PRINTER_DECL(void, print_sigevent, struct tcb *tcp, const long addr) tprints("{"); if (sev.sigev_value.sival_ptr) { - tprintf("sigev_value={int=%d, ptr=", + tprintf("sigev_value={sival_int=%d, sival_ptr=", sev.sigev_value.sival_int); printaddr((unsigned long) sev.sigev_value.sival_ptr); tprints("}, "); diff --git a/tests/mq_sendrecv.c b/tests/mq_sendrecv.c index 34eb97c8..995bbb0d 100644 --- a/tests/mq_sendrecv.c +++ b/tests/mq_sendrecv.c @@ -372,7 +372,7 @@ main(void) /* Invalid SIGEV_* */ rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); - printf("mq_notify(%d, {sigev_value={int=%d, ptr=%#lx}" + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}" ", sigev_signo=%u, sigev_notify=%#x /* SIGEV_??? */}) = %s\n", (int) bogus_fd, bogus_sev->sigev_value.sival_int, bogus_sev->sigev_value.sival_ptr, @@ -382,7 +382,7 @@ main(void) /* SIGEV_NONE */ bogus_sev->sigev_notify = SIGEV_NONE; rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); - printf("mq_notify(%d, {sigev_value={int=%d, ptr=%#lx}, " + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " "sigev_signo=%u, sigev_notify=SIGEV_NONE}) = %s\n", (int) bogus_fd, bogus_sev->sigev_value.sival_int, bogus_sev->sigev_value.sival_ptr, @@ -392,7 +392,7 @@ main(void) bogus_sev->sigev_notify = SIGEV_SIGNAL; bogus_sev->sigev_signo = SIGALRM; rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); - printf("mq_notify(%d, {sigev_value={int=%d, ptr=%#lx}, " + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " "sigev_signo=SIGALRM, sigev_notify=SIGEV_SIGNAL}) = %s\n", (int) bogus_fd, bogus_sev->sigev_value.sival_int, bogus_sev->sigev_value.sival_ptr, sprintrc(rc)); @@ -404,7 +404,7 @@ main(void) bogus_sev->sigev_un.sigev_thread.attribute = (unsigned long) 0xcafef00dfacefeedULL; rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); - printf("mq_notify(%d, {sigev_value={int=%d, ptr=%#lx}, " + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " "sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD, " "sigev_notify_function=%#lx, sigev_notify_attributes=%#lx}) = " "%s\n", diff --git a/tests/timer_create.c b/tests/timer_create.c index f13b7b04..1a259627 100644 --- a/tests/timer_create.c +++ b/tests/timer_create.c @@ -53,9 +53,9 @@ main(void) }; syscall(__NR_timer_create, CLOCK_REALTIME, &sev, NULL); - printf("timer_create(CLOCK_REALTIME, {sigev_value={int=%d, ptr=%#lx}" - ", sigev_signo=%u, sigev_notify=%#x /* SIGEV_??? */}" - ", NULL) = -1 %s (%m)\n", + printf("timer_create(CLOCK_REALTIME, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=%u, " + "sigev_notify=%#x /* SIGEV_??? */}, NULL) = -1 %s (%m)\n", sev.sigev_value.sival_int, sev.sigev_value.sival_ptr, sev.sigev_signo, sev.sigev_notify, @@ -64,8 +64,9 @@ main(void) sev.sigev_notify = SIGEV_NONE; if (syscall(__NR_timer_create, CLOCK_REALTIME, &sev, &tid[0])) perror_msg_and_skip("timer_create CLOCK_REALTIME"); - printf("timer_create(CLOCK_REALTIME, {sigev_value={int=%d, ptr=%#lx}" - ", sigev_signo=%u, sigev_notify=SIGEV_NONE}, [%d]) = 0\n", + printf("timer_create(CLOCK_REALTIME, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=%u, sigev_notify=SIGEV_NONE}, " + "[%d]) = 0\n", sev.sigev_value.sival_int, sev.sigev_value.sival_ptr, sev.sigev_signo, tid[0]); @@ -74,9 +75,9 @@ main(void) sev.sigev_signo = SIGALRM; if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid[1])) perror_msg_and_skip("timer_create CLOCK_MONOTONIC"); - printf("timer_create(CLOCK_MONOTONIC, {sigev_value={int=%d, ptr=%#lx}" - ", sigev_signo=SIGALRM, sigev_notify=SIGEV_SIGNAL}" - ", [%d]) = 0\n", + printf("timer_create(CLOCK_MONOTONIC, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=SIGALRM, " + "sigev_notify=SIGEV_SIGNAL}, [%d]) = 0\n", sev.sigev_value.sival_int, sev.sigev_value.sival_ptr, tid[1]); @@ -87,8 +88,8 @@ main(void) (unsigned long) 0xcafef00dfacefeedULL; if (syscall(__NR_timer_create, CLOCK_REALTIME, &sev, &tid[2])) perror_msg_and_skip("timer_create CLOCK_REALTIME"); - printf("timer_create(CLOCK_REALTIME, {sigev_value={int=%d, ptr=%#lx}" - ", sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD" + printf("timer_create(CLOCK_REALTIME, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD" ", sigev_notify_function=%#lx, sigev_notify_attributes=%#lx}" ", [%d]) = 0\n", sev.sigev_value.sival_int, @@ -104,9 +105,9 @@ main(void) sev.sigev_un.tid = getpid(); if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid[3])) perror_msg_and_skip("timer_create CLOCK_MONOTONIC"); - printf("timer_create(CLOCK_MONOTONIC, {sigev_value={int=%d, ptr=%#lx}" - ", sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD_ID" - ", sigev_notify_thread_id=%d}" + printf("timer_create(CLOCK_MONOTONIC, {sigev_value={sival_int=%d, " + "sival_ptr=%#lx}, sigev_signo=SIGALRM, " + "sigev_notify=SIGEV_THREAD_ID, sigev_notify_thread_id=%d}" ", [%d]) = 0\n", sev.sigev_value.sival_int, sev.sigev_value.sival_ptr, -- 2.40.0