From 34213b2037e6ee6ee9dc3d8070886a37131406a1 Mon Sep 17 00:00:00 2001 From: guenther <> Date: Sun, 13 Mar 2016 18:34:21 +0000 Subject: [PATCH] environ and __progname are not declared in a public header; declare them in libc's hidden/stdlib.h instead of in each .c file that needs one ok deraadt@ gsoares@ mpi@ --- src/lib/libc/stdlib/getenv.c | 3 +-- src/lib/libc/stdlib/malloc.c | 4 +--- src/lib/libc/stdlib/setenv.c | 3 +-- src/lib/libc/stdlib/system.c | 4 +--- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/lib/libc/stdlib/getenv.c b/src/lib/libc/stdlib/getenv.c index 6ddad922..054497b4 100644 --- a/src/lib/libc/stdlib/getenv.c +++ b/src/lib/libc/stdlib/getenv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getenv.c,v 1.11 2015/09/13 08:31:47 guenther Exp $ */ +/* $OpenBSD: getenv.c,v 1.12 2016/03/13 18:34:21 guenther Exp $ */ /* * Copyright (c) 1987, 1993 * The Regents of the University of California. All rights reserved. @@ -45,7 +45,6 @@ char * __findenv(const char *name, int len, int *offset) { - extern char **environ; int i; const char *np; char **p, *cp; diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c index d22fb38d..24b22854 100644 --- a/src/lib/libc/stdlib/malloc.c +++ b/src/lib/libc/stdlib/malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.c,v 1.182 2016/02/25 00:38:51 deraadt Exp $ */ +/* $OpenBSD: malloc.c,v 1.183 2016/03/13 18:34:21 guenther Exp $ */ /* * Copyright (c) 2008, 2010, 2011 Otto Moerbeek * Copyright (c) 2012 Matthew Dempsky @@ -208,8 +208,6 @@ static int malloc_active; /* status of malloc */ static u_char getrbyte(struct dir_info *d); -extern char *__progname; - #ifdef MALLOC_STATS void malloc_dump(int); PROTO_NORMAL(malloc_dump); diff --git a/src/lib/libc/stdlib/setenv.c b/src/lib/libc/stdlib/setenv.c index e55a1feb..1182abda 100644 --- a/src/lib/libc/stdlib/setenv.c +++ b/src/lib/libc/stdlib/setenv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: setenv.c,v 1.16 2015/09/13 08:31:47 guenther Exp $ */ +/* $OpenBSD: setenv.c,v 1.17 2016/03/13 18:34:21 guenther Exp $ */ /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. @@ -32,7 +32,6 @@ #include #include -extern char **environ; static char **lastenv; /* last value of environ */ /* diff --git a/src/lib/libc/stdlib/system.c b/src/lib/libc/stdlib/system.c index de32d432..fe718276 100644 --- a/src/lib/libc/stdlib/system.c +++ b/src/lib/libc/stdlib/system.c @@ -1,4 +1,4 @@ -/* $OpenBSD: system.c,v 1.11 2015/10/23 04:44:41 guenther Exp $ */ +/* $OpenBSD: system.c,v 1.12 2016/03/13 18:34:21 guenther Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. * All rights reserved. @@ -36,8 +36,6 @@ #include #include -extern char **environ; - int system(const char *command) {