Source-Changes-HG archive

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

[src/trunk]: src/sys/kern handle O_NOSIGPIPE too.



details:   https://anonhg.NetBSD.org/src/rev/81639f1006a4
branches:  trunk
changeset: 997081:81639f1006a4
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Feb 20 19:42:14 2019 +0000

description:
handle O_NOSIGPIPE too.

diffstat:

 sys/kern/kern_descrip.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r e91878d36816 -r 81639f1006a4 sys/kern/kern_descrip.c
--- a/sys/kern/kern_descrip.c   Wed Feb 20 18:19:46 2019 +0000
+++ b/sys/kern/kern_descrip.c   Wed Feb 20 19:42:14 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_descrip.c,v 1.242 2019/01/03 10:16:43 maxv Exp $  */
+/*     $NetBSD: kern_descrip.c,v 1.243 2019/02/20 19:42:14 christos Exp $      */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.242 2019/01/03 10:16:43 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.243 2019/02/20 19:42:14 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -750,7 +750,7 @@
        fdfile_t *ff;
        fdtab_t *dt;
 
-       if (flags & ~(O_CLOEXEC|O_NONBLOCK))
+       if (flags & ~(O_CLOEXEC|O_NONBLOCK|O_NOSIGPIPE))
                return EINVAL;
        /*
         * Ensure there are enough slots in the descriptor table,
@@ -791,7 +791,7 @@
        mutex_exit(&fdp->fd_lock);
 
        dt->dt_ff[newfd]->ff_exclose = (flags & O_CLOEXEC) != 0;
-       fp->f_flag |= flags & FNONBLOCK;
+       fp->f_flag |= flags & (FNONBLOCK|FNOSIGPIPE);
        /* Slot is now allocated.  Insert copy of the file. */
        fd_affix(curproc, fp, newfd);
        if (ff != NULL) {



Home | Main Index | Thread Index | Old Index