]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] sigio delivery fix
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 22 May 2002 05:23:20 +0000 (22:23 -0700)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Wed, 22 May 2002 05:23:20 +0000 (22:23 -0700)
Stephen Rothwell <sfr@canb.auug.org.au>: fix for sigio delivery:
  Hi Linus,

  This patch means that we keep the upper 16 bits of the si_code
  field of the siginfo structure that is delivered with and SIGIOs.
  We need this so that the code that actually copies the siginfo_t
  out to user mode knows which part of the union to copy.  We currently
  get away with out this information because we always copy at least
  two ints worth of the union, but this s an ugly hack and I would
  like to tidy it up.

  Comments?

fs/fcntl.c

index b783d93907296bf361d00a4c6323033bf88b8b5a..bdc7aa220fd896debbe968db9d21c5ca7d9fcd88 100644 (file)
@@ -435,7 +435,7 @@ static void send_sigio_to_task(struct task_struct *p,
                           back to SIGIO in that case. --sct */
                        si.si_signo = fown->signum;
                        si.si_errno = 0;
-                       si.si_code  = reason & ~__SI_MASK;
+                       si.si_code  = reason;
                        /* Make sure we are called with one of the POLL_*
                           reasons, otherwise we could leak kernel stack into
                           userspace.  */