- (dtucker) [openbsd-compat/setproctitle.c] Ensure SPT_TYPE is defined before

testing its value.

When HAVE_SETPROCTITLE is defined (at least on NetBSD, gcc 2.95.3) the test
"#if SPT_TYPE == SPT_REUSEARGV" is not true (probably because SPT_TYPE or
SPT_REUSEARGV is not defined).  This results in the following build error:

$ gcc [flags] setproctitle.c
setproctitle.c: In function `compat_init_setproctitle':
setproctitle.c:102: `argv_start' undeclared (first use in this function)
This commit is contained in:
Darren Tucker 2003-06-22 18:32:10 +10:00
parent e0194e52ca
commit 6cf1a2cfe8
2 changed files with 4 additions and 2 deletions

View File

@ -4,6 +4,8 @@
[reconfigure.sh] [reconfigure.sh]
missing $SUDO; from dtucker@zip.com.au missing $SUDO; from dtucker@zip.com.au
- (dtucker) [regress/authorized_keys_root] Remove temp data file from CVS. - (dtucker) [regress/authorized_keys_root] Remove temp data file from CVS.
- (dtucker) [openbsd-compat/setproctitle.c] Ensure SPT_TYPE is defined before
testing its value.
20030618 20030618
- (djm) OpenBSD CVS Sync - (djm) OpenBSD CVS Sync
@ -567,4 +569,4 @@
- Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
Report from murple@murple.net, diagnosis from dtucker@zip.com.au Report from murple@murple.net, diagnosis from dtucker@zip.com.au
$Id: ChangeLog,v 1.2817 2003/06/22 02:33:27 dtucker Exp $ $Id: ChangeLog,v 1.2818 2003/06/22 08:32:10 dtucker Exp $

View File

@ -62,7 +62,7 @@ static size_t argv_env_len = 0;
void void
compat_init_setproctitle(int argc, char *argv[]) compat_init_setproctitle(int argc, char *argv[])
{ {
#if SPT_TYPE == SPT_REUSEARGV #if defined(SPT_TYPE) && SPT_TYPE == SPT_REUSEARGV
extern char **environ; extern char **environ;
char *lastargv = NULL; char *lastargv = NULL;
char **envp = environ; char **envp = environ;