summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/popen.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2002-01-16 01:28:54 +0000
committermillert <millert@openbsd.org>2002-01-16 01:28:54 +0000
commitfc8048171e0691ce3520db453b5ebfdb4f1dc5e6 (patch)
treecd2b081daa4ea66115d5b3e0c3567d99f8144953 /lib/libc/gen/popen.c
parentJust tested a Eumitcom WL11000P in the guise of a Belkin F5D6000. (diff)
downloadwireguard-openbsd-fc8048171e0691ce3520db453b5ebfdb4f1dc5e6.tar.xz
wireguard-openbsd-fc8048171e0691ce3520db453b5ebfdb4f1dc5e6.zip
Use the volatile specifier to fix warnings about variables being
clobbered by longjmp / vfork instead of the gcc "(void)&foo;" hack.
Diffstat (limited to 'lib/libc/gen/popen.c')
-rw-r--r--lib/libc/gen/popen.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c
index aa21ca3e957..f26612133bb 100644
--- a/lib/libc/gen/popen.c
+++ b/lib/libc/gen/popen.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: popen.c,v 1.11 2002/01/02 20:18:31 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: popen.c,v 1.12 2002/01/16 01:28:54 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -60,15 +60,11 @@ popen(program, type)
const char *program;
const char *type;
{
- struct pid *cur;
+ struct pid * volatile cur;
FILE *iop;
int pdes[2];
pid_t pid;
-#ifdef __GNUC__
- (void)&cur;
-#endif
-
if ((*type != 'r' && *type != 'w') || type[1] != '\0') {
errno = EINVAL;
return (NULL);