Source-Changes-HG archive

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

[src/trunk]: src/sys When SS_RESTARTSYS was added, it was accidentally given ...



details:   https://anonhg.NetBSD.org/src/rev/6d8b922e2d01
branches:  trunk
changeset: 957102:6d8b922e2d01
user:      chs <chs%NetBSD.org@localhost>
date:      Tue Nov 17 03:22:33 2020 +0000

description:
When SS_RESTARTSYS was added, it was accidentally given the same value as
the existing SS_ASYNC.  SS_ASYNC was already vestigial at that point,
having been superceded by SB_ASYNC, however the SS_ASYNC flag is still
set and cleared, unlessly because it is never checked.
Fix this conflict by removing SS_ASYNC and its vestigial uses.

diffstat:

 sys/kern/sys_socket.c |  6 ++----
 sys/sys/socketvar.h   |  3 +--
 2 files changed, 3 insertions(+), 6 deletions(-)

diffs (47 lines):

diff -r f6419db6e855 -r 6d8b922e2d01 sys/kern/sys_socket.c
--- a/sys/kern/sys_socket.c     Tue Nov 17 03:20:33 2020 +0000
+++ b/sys/kern/sys_socket.c     Tue Nov 17 03:22:33 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_socket.c,v 1.78 2018/12/04 00:18:05 maya Exp $     */
+/*     $NetBSD: sys_socket.c,v 1.79 2020/11/17 03:22:33 chs Exp $      */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_socket.c,v 1.78 2018/12/04 00:18:05 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_socket.c,v 1.79 2020/11/17 03:22:33 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -141,11 +141,9 @@
        case FIOASYNC:
                solock(so);
                if (*(int *)data) {
-                       so->so_state |= SS_ASYNC;
                        so->so_rcv.sb_flags |= SB_ASYNC;
                        so->so_snd.sb_flags |= SB_ASYNC;
                } else {
-                       so->so_state &= ~SS_ASYNC;
                        so->so_rcv.sb_flags &= ~SB_ASYNC;
                        so->so_snd.sb_flags &= ~SB_ASYNC;
                }
diff -r f6419db6e855 -r 6d8b922e2d01 sys/sys/socketvar.h
--- a/sys/sys/socketvar.h       Tue Nov 17 03:20:33 2020 +0000
+++ b/sys/sys/socketvar.h       Tue Nov 17 03:22:33 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: socketvar.h,v 1.161 2020/10/05 08:38:17 roy Exp $      */
+/*     $NetBSD: socketvar.h,v 1.162 2020/11/17 03:22:33 chs Exp $      */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -199,7 +199,6 @@
 #define        SS_RESTARTSYS           0x100   /* restart blocked system calls */
 #define        SS_ISDISCONNECTED       0x800   /* socket disconnected from peer */
 
-#define        SS_ASYNC                0x100   /* async i/o notify */
 #define        SS_MORETOCOME           0x400   /*
                                         * hint from sosend to lower layer;
                                         * more data coming



Home | Main Index | Thread Index | Old Index