summaryrefslogtreecommitdiffstats
path: root/lib/librthread
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2020-10-12 22:08:32 +0000
committerderaadt <deraadt@openbsd.org>2020-10-12 22:08:32 +0000
commit87afc19ed9256ae3cb7c5266911abf02218c2a35 (patch)
tree5accbaf0292e5c1fca2cd342ddcac4906b6e95f9 /lib/librthread
parentannoying whitespace (diff)
downloadwireguard-openbsd-87afc19ed9256ae3cb7c5266911abf02218c2a35.tar.xz
wireguard-openbsd-87afc19ed9256ae3cb7c5266911abf02218c2a35.zip
make fixed-sized fixed-value mib[] arrays be const
ok guenther tb millert
Diffstat (limited to 'lib/librthread')
-rw-r--r--lib/librthread/rthread_np.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/librthread/rthread_np.c b/lib/librthread/rthread_np.c
index 64bd2db5aea..0b3f821ca7b 100644
--- a/lib/librthread/rthread_np.c
+++ b/lib/librthread/rthread_np.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rthread_np.c,v 1.21 2019/02/04 17:18:08 tedu Exp $ */
+/* $OpenBSD: rthread_np.c,v 1.22 2020/10/12 22:08:34 deraadt Exp $ */
/*
* Copyright (c) 2004,2005 Ted Unangst <tedu@openbsd.org>
* Copyright (c) 2005 Otto Moerbeek <otto@openbsd.org>
@@ -90,14 +90,12 @@ pthread_stackseg_np(pthread_t thread, stack_t *sinfo)
_rthread_init();
if (gotself == 0) {
- int mib[2];
+ const int mib[2] = { CTL_VM, VM_PSSTRINGS };
size_t len;
if (getrlimit(RLIMIT_STACK, &rl) != 0)
return (EAGAIN);
- mib[0] = CTL_VM;
- mib[1] = VM_PSSTRINGS;
len = sizeof(_ps);
if (sysctl(mib, 2, &_ps, &len, NULL, 0) != 0)
return (EAGAIN);