summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthib <thib@openbsd.org>2009-08-10 16:49:38 +0000
committerthib <thib@openbsd.org>2009-08-10 16:49:38 +0000
commit9ed051c75c2270aa42d6427a041f6f4e7abbd0d2 (patch)
tree8e60ca70f2fdec27d85261d270607bb0d79f31b6
parentright now, we only increment ci_idepth in struct cpuinfo when (diff)
downloadwireguard-openbsd-9ed051c75c2270aa42d6427a041f6f4e7abbd0d2.tar.xz
wireguard-openbsd-9ed051c75c2270aa42d6427a041f6f4e7abbd0d2.zip
Don't use char arrays for sleep wchans and reuse them.
just use strings and make things unique. ok claudio@
-rw-r--r--sys/kern/uipc_socket.c4
-rw-r--r--sys/kern/uipc_socket2.c12
-rw-r--r--sys/kern/uipc_syscalls.c6
-rw-r--r--sys/sys/socketvar.h5
4 files changed, 9 insertions, 18 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 3c56aee1b3e..9998ccae763 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.77 2009/06/05 00:05:21 claudio Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.78 2009/08/10 16:49:38 thib Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -230,7 +230,7 @@ soclose(struct socket *so)
goto drop;
while (so->so_state & SS_ISCONNECTED) {
error = tsleep(&so->so_timeo,
- PSOCK | PCATCH, netcls,
+ PSOCK | PCATCH, "netcls",
so->so_linger * hz);
if (error)
break;
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c
index a6590c7afcc..bb53e2cc12d 100644
--- a/sys/kern/uipc_socket2.c
+++ b/sys/kern/uipc_socket2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket2.c,v 1.48 2009/03/30 14:29:30 blambert Exp $ */
+/* $OpenBSD: uipc_socket2.c,v 1.49 2009/08/10 16:49:39 thib Exp $ */
/* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */
/*
@@ -50,12 +50,6 @@
* Primitive routines for operating on sockets and socket buffers
*/
-/* strings for sleep message: */
-const char netcon[] = "netcon";
-const char netcls[] = "netcls";
-const char netio[] = "netio";
-const char netlck[] = "netlck";
-
u_long sb_max = SB_MAX; /* patchable */
extern struct pool mclpools[];
@@ -283,7 +277,7 @@ sbwait(struct sockbuf *sb)
sb->sb_flags |= SB_WAIT;
return (tsleep(&sb->sb_cc,
- (sb->sb_flags & SB_NOINTR) ? PSOCK : PSOCK | PCATCH, netio,
+ (sb->sb_flags & SB_NOINTR) ? PSOCK : PSOCK | PCATCH, "netio",
sb->sb_timeo));
}
@@ -300,7 +294,7 @@ sb_lock(struct sockbuf *sb)
sb->sb_flags |= SB_WANT;
error = tsleep(&sb->sb_flags,
(sb->sb_flags & SB_NOINTR) ?
- PSOCK : PSOCK|PCATCH, netlck, 0);
+ PSOCK : PSOCK|PCATCH, "netlck", 0);
if (error)
return (error);
}
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index afd5aa1dafa..b8b0fb9262e 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_syscalls.c,v 1.70 2009/02/22 07:47:22 otto Exp $ */
+/* $OpenBSD: uipc_syscalls.c,v 1.71 2009/08/10 16:49:39 thib Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */
/*
@@ -176,7 +176,7 @@ sys_accept(struct proc *p, void *v, register_t *retval)
head->so_error = ECONNABORTED;
break;
}
- error = tsleep(&head->so_timeo, PSOCK | PCATCH, netcon, 0);
+ error = tsleep(&head->so_timeo, PSOCK | PCATCH, "netcon", 0);
if (error) {
goto bad;
}
@@ -287,7 +287,7 @@ sys_connect(struct proc *p, void *v, register_t *retval)
s = splsoftnet();
while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) {
error = tsleep(&so->so_timeo, PSOCK | PCATCH,
- netcon, 0);
+ "netcon2", 0);
if (error)
break;
}
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h
index 8929f5a1e02..14af61bfadb 100644
--- a/sys/sys/socketvar.h
+++ b/sys/sys/socketvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: socketvar.h,v 1.45 2009/02/22 07:47:22 otto Exp $ */
+/* $OpenBSD: socketvar.h,v 1.46 2009/08/10 16:49:38 thib Exp $ */
/* $NetBSD: socketvar.h,v 1.18 1996/02/09 18:25:38 christos Exp $ */
/*-
@@ -227,9 +227,6 @@ struct socket {
extern u_long sb_max;
struct socket *sonewconn(struct socket *head, int connstatus);
-/* strings for sleep message: */
-extern const char netio[], netcon[], netcls[];
-
extern struct pool socket_pool;
struct mbuf;