diff options
author | 2013-04-11 04:30:59 +0000 | |
---|---|---|
committer | 2013-04-11 04:30:59 +0000 | |
commit | c4cf32ecaa6a9a9b95c66f744acecdc830f42a74 (patch) | |
tree | 8fb6188a96badaec7d1b7e19a42ca2b2361ae7d2 | |
parent | getpgid() and getsid() were rolled into POSIX in 2008 (diff) | |
download | wireguard-openbsd-c4cf32ecaa6a9a9b95c66f744acecdc830f42a74.tar.xz wireguard-openbsd-c4cf32ecaa6a9a9b95c66f744acecdc830f42a74.zip |
copy out a blank string if no wmesg, so userland can rely on reading
p_wmesg[0] and not find junk leftover from before
-rw-r--r-- | sys/sys/sysctl.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index e91308bd9c8..16e489c0700 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sysctl.h,v 1.132 2013/04/06 03:44:34 tedu Exp $ */ +/* $OpenBSD: sysctl.h,v 1.133 2013/04/11 04:30:59 tedu Exp $ */ /* $NetBSD: sysctl.h,v 1.16 1996/04/09 20:55:36 cgd Exp $ */ /* @@ -558,6 +558,9 @@ do { \ if ((p)->p_wmesg) \ copy_str((kp)->p_wmesg, (p)->p_wmesg, \ sizeof((kp)->p_wmesg)); \ + else \ + copy_str((kp)->p_wmesg, "", \ + sizeof((kp)->p_wmesg)); \ if (show_addresses) \ (kp)->p_wchan = PTRTOINT64((p)->p_wchan); \ } \ |