diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2020-10-12 22:08:35 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2020-10-12 22:08:35 +0000 |
commit | a575eb26f0ae95d94ff18ee8b482e93c08feb91b (patch) | |
tree | 12eda421b3d080a63f6605f44cc731ab0fa3d34e /lib/librthread/rthread_np.c | |
parent | ef53b0617ae0009192465f85b3eebc8715d9108d (diff) |
make fixed-sized fixed-value mib[] arrays be const
ok guenther tb millert
Diffstat (limited to 'lib/librthread/rthread_np.c')
-rw-r--r-- | lib/librthread/rthread_np.c | 6 |
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); |