Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/kern Pull up revision 1.49 (requested by thorpej):



details:   https://anonhg.NetBSD.org/src/rev/2c5ba8448d32
branches:  netbsd-1-5
changeset: 491871:2c5ba8448d32
user:      he <he%NetBSD.org@localhost>
date:      Sun Jun 10 18:23:03 2001 +0000

description:
Pull up revision 1.49 (requested by thorpej):
  Change fdalloc() to return ERESTART if reallocation of the
  descriptor array was needed, and change uses to handle that
  condition.  Make finishdup() close the descriptor in the new slot
  if it exists, and change sys_dup2() accordingly.  Closes a race
  condition when using kernel-assisted user threads.

diffstat:

 sys/kern/uipc_usrreq.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r 3ac5fe844c11 -r 2c5ba8448d32 sys/kern/uipc_usrreq.c
--- a/sys/kern/uipc_usrreq.c    Sun Jun 10 18:22:45 2001 +0000
+++ b/sys/kern/uipc_usrreq.c    Sun Jun 10 18:23:03 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_usrreq.c,v 1.48 2000/06/05 16:29:45 thorpej Exp $ */
+/*     $NetBSD: uipc_usrreq.c,v 1.48.2.1 2001/06/10 18:23:03 he Exp $  */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -806,7 +806,7 @@
        int i, *fdp;
        struct file **rp;
        struct file *fp;
-       int nfds, f, error = 0;
+       int nfds, f, error = 0, err;
 
        nfds = (cm->cmsg_len - CMSG_ALIGN(sizeof(*cm))) /
            sizeof(struct file *);
@@ -861,8 +861,13 @@
                fp->f_msgcount--;
                unp_rights--;
                
-               if (fdalloc(p, 0, &f))
-                       panic("unp_externalize");
+               if ((err = fdalloc(p, 0, &f)) != 0) {
+                       /*
+                        * XXXSMP -- FIX ME, PLEASE.
+                        */
+                       if (err != ERESTART)
+                               panic("unp_externalize");
+               }
                p->p_fd->fd_ofiles[f] = fp;
                *fdp++ = f;
        }



Home | Main Index | Thread Index | Old Index