summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2021-06-07 09:10:33 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2021-06-07 09:10:33 +0000
commit9f89819427f4a9935833066c492581c47ac58917 (patch)
tree5d9f12a12ffc1219505955bb552fdca8c836c0b3
parent83e94157343972f116ece1c612c5fce2acca0fed (diff)
Kill SS_ASYNC and only check SB_ASYNC when async signals are wanted.
This socket flag was redundant with the socket buffer one. ok mvs@
-rw-r--r--sys/kern/sys_socket.c4
-rw-r--r--sys/kern/uipc_socket2.c6
-rw-r--r--sys/sys/socketvar.h3
3 files changed, 5 insertions, 8 deletions
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c
index 9078002abbc..f522890eb29 100644
--- a/sys/kern/sys_socket.c
+++ b/sys/kern/sys_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_socket.c,v 1.45 2020/02/22 11:58:29 anton Exp $ */
+/* $OpenBSD: sys_socket.c,v 1.46 2021/06/07 09:10:32 mpi Exp $ */
/* $NetBSD: sys_socket.c,v 1.13 1995/08/12 23:59:09 mycroft Exp $ */
/*
@@ -96,11 +96,9 @@ soo_ioctl(struct file *fp, u_long cmd, caddr_t data, struct proc *p)
case FIOASYNC:
s = 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 --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c
index 07ecd09627d..69ec14230e6 100644
--- a/sys/kern/uipc_socket2.c
+++ b/sys/kern/uipc_socket2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket2.c,v 1.110 2021/05/26 08:28:34 mvs Exp $ */
+/* $OpenBSD: uipc_socket2.c,v 1.111 2021/06/07 09:10:32 mpi Exp $ */
/* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */
/*
@@ -409,7 +409,7 @@ sbunlock(struct socket *so, struct sockbuf *sb)
/*
* Wakeup processes waiting on a socket buffer.
* Do asynchronous notification via SIGIO
- * if the socket has the SS_ASYNC flag set.
+ * if the socket buffer has the SB_ASYNC flag set.
*/
void
sowakeup(struct socket *so, struct sockbuf *sb)
@@ -421,7 +421,7 @@ sowakeup(struct socket *so, struct sockbuf *sb)
sb->sb_flags &= ~SB_WAIT;
wakeup(&sb->sb_cc);
}
- if (so->so_state & SS_ASYNC)
+ if (sb->sb_flags & SB_ASYNC)
pgsigio(&so->so_sigio, SIGIO, 0);
selwakeup(&sb->sb_sel);
}
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h
index 569c1a09c30..72bb18d3e59 100644
--- a/sys/sys/socketvar.h
+++ b/sys/sys/socketvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: socketvar.h,v 1.97 2021/05/21 10:59:02 mvs Exp $ */
+/* $OpenBSD: socketvar.h,v 1.98 2021/06/07 09:10:32 mpi Exp $ */
/* $NetBSD: socketvar.h,v 1.18 1996/02/09 18:25:38 christos Exp $ */
/*-
@@ -147,7 +147,6 @@ struct socket {
#define SS_ISDISCONNECTED 0x800 /* socket disconnected from peer */
#define SS_PRIV 0x080 /* privileged for broadcast, raw... */
-#define SS_ASYNC 0x200 /* async i/o notify */
#define SS_CONNECTOUT 0x1000 /* connect, not accept, at this end */
#define SS_ISSENDING 0x2000 /* hint for lower layer */
#define SS_DNS 0x4000 /* created using SOCK_DNS socket(2) */