public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] Also check si_code == SI_MESGQ in tst-mqueue5
Date: Thu, 15 Apr 2004 04:02:00 -0000	[thread overview]
Message-ID: <20040414200753.GC514@sunsite.ms.mff.cuni.cz> (raw)

Hi!

Tought it would be better to check this as well...

2004-04-15  Jakub Jelinek  <jakub@redhat.com>

	* rt/tst-mqueue5.c (rtmin_code): New variable.
	(rtmin_handler): Set it.
	(thr, do_child, do_test): Also check rtmin_code.

--- libc/rt/tst-mqueue5.c.jj	2004-04-13 16:20:39.000000000 +0200
+++ libc/rt/tst-mqueue5.c	2004-04-15 00:15:33.922186683 +0200
@@ -42,6 +42,7 @@
 volatile int rtmin_cnt;
 volatile pid_t rtmin_pid;
 volatile uid_t rtmin_uid;
+volatile int rtmin_code;
 volatile union sigval rtmin_sigval;
 
 static void
@@ -52,6 +53,7 @@ rtmin_handler (int sig, siginfo_t *info,
   ++rtmin_cnt;
   rtmin_pid = info->si_pid;
   rtmin_uid = info->si_uid;
+  rtmin_code = info->si_code;
   rtmin_sigval = info->si_value;
 }
 
@@ -120,11 +122,12 @@ thr (void *arg)
     }
   else if (rtmin_pid != getppid ()
 	   || rtmin_uid != getuid ()
+	   || rtmin_code != SI_MESGQ
 	   || rtmin_sigval.sival_int != 0xdeadbeef)
     {
-      printf ("unexpected siginfo_t fields: pid %u (%u), uid %u (%u), si_int %d (%d)\n",
+      printf ("unexpected siginfo_t fields: pid %u (%u), uid %u (%u), code %d (%d), si_int %d (%d)\n",
 	      rtmin_pid, getppid (), rtmin_uid, getuid (),
-	      rtmin_sigval.sival_int, 0xdeadbeef);
+	      rtmin_code, SI_MESGQ, rtmin_sigval.sival_int, 0xdeadbeef);
       result = 1;
     }
 
@@ -286,11 +289,12 @@ do_child (const char *name, pthread_barr
     }
   else if (rtmin_pid != getppid ()
 	   || rtmin_uid != getuid ()
+	   || rtmin_code != SI_MESGQ
 	   || rtmin_sigval.sival_ptr != &ev)
     {
-      printf ("unexpected siginfo_t fields: pid %u (%u), uid %u (%u), si_ptr %p (%p)\n",
+      printf ("unexpected siginfo_t fields: pid %u (%u), uid %u (%u), code %d (%d), si_ptr %p (%p)\n",
 	      rtmin_pid, getppid (), rtmin_uid, getuid (),
-	      rtmin_sigval.sival_ptr, &ev);
+	      rtmin_code, SI_MESGQ, rtmin_sigval.sival_ptr, &ev);
       result = 1;
     }
 
@@ -704,11 +708,12 @@ do_test (void)
     }
   else if (rtmin_pid != getpid ()
 	   || rtmin_uid != getuid ()
+	   || rtmin_code != SI_MESGQ
 	   || rtmin_sigval.sival_int != 26)
     {
-      printf ("unexpected siginfo_t fields: pid %u (%u), uid %u (%u), si_int %d (26)\n",
+      printf ("unexpected siginfo_t fields: pid %u (%u), uid %u (%u), code %d (%d), si_int %d (26)\n",
 	      rtmin_pid, getpid (), rtmin_uid, getuid (),
-	      rtmin_sigval.sival_int);
+	      rtmin_code, SI_MESGQ, rtmin_sigval.sival_int);
       result = 1;
     }
 
@@ -807,11 +812,12 @@ do_test (void)
     }
   else if (rtmin_pid != pid
 	   || rtmin_uid != getuid ()
+	   || rtmin_code != SI_MESGQ
 	   || rtmin_sigval.sival_int != 15)
     {
-      printf ("unexpected siginfo_t fields: pid %u (%u), uid %u (%u), si_int %d (15)\n",
+      printf ("unexpected siginfo_t fields: pid %u (%u), uid %u (%u), code %d (%d), si_int %d (15)\n",
 	      rtmin_pid, pid, rtmin_uid, getuid (),
-	      rtmin_sigval.sival_int);
+	      rtmin_code, SI_MESGQ, rtmin_sigval.sival_int);
       result = 1;
     }
 

	Jakub

             reply	other threads:[~2004-04-15  4:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-15  4:02 Jakub Jelinek [this message]
2004-04-16 19:46 ` Ulrich Drepper

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=20040414200753.GC514@sunsite.ms.mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=drepper@redhat.com \
    --cc=libc-hacker@sources.redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).