Browse Source

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@
OPENBSD_6_0
guenther 8 years ago
parent
commit
34213b2037
4 changed files with 4 additions and 10 deletions
  1. +1
    -2
      src/lib/libc/stdlib/getenv.c
  2. +1
    -3
      src/lib/libc/stdlib/malloc.c
  3. +1
    -2
      src/lib/libc/stdlib/setenv.c
  4. +1
    -3
      src/lib/libc/stdlib/system.c

+ 1
- 2
src/lib/libc/stdlib/getenv.c View File

@ -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 * Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved. * The Regents of the University of California. All rights reserved.
@ -45,7 +45,6 @@
char * char *
__findenv(const char *name, int len, int *offset) __findenv(const char *name, int len, int *offset)
{ {
extern char **environ;
int i; int i;
const char *np; const char *np;
char **p, *cp; char **p, *cp;


+ 1
- 3
src/lib/libc/stdlib/malloc.c View File

@ -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 <otto@drijf.net> * Copyright (c) 2008, 2010, 2011 Otto Moerbeek <otto@drijf.net>
* Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
@ -208,8 +208,6 @@ static int malloc_active; /* status of malloc */
static u_char getrbyte(struct dir_info *d); static u_char getrbyte(struct dir_info *d);
extern char *__progname;
#ifdef MALLOC_STATS #ifdef MALLOC_STATS
void malloc_dump(int); void malloc_dump(int);
PROTO_NORMAL(malloc_dump); PROTO_NORMAL(malloc_dump);


+ 1
- 2
src/lib/libc/stdlib/setenv.c View File

@ -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. * Copyright (c) 1987 Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -32,7 +32,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
extern char **environ;
static char **lastenv; /* last value of environ */ static char **lastenv; /* last value of environ */
/* /*


+ 1
- 3
src/lib/libc/stdlib/system.c View File

@ -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. * Copyright (c) 1988 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -36,8 +36,6 @@
#include <unistd.h> #include <unistd.h>
#include <paths.h> #include <paths.h>
extern char **environ;
int int
system(const char *command) system(const char *command)
{ {


Loading…
Cancel
Save