diff options
author | Mattias Andrée <maandree@member.fsf.org> | 2015-12-21 15:38:38 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@member.fsf.org> | 2015-12-21 15:38:38 +0100 |
commit | 80ce6dad1e3991b95692960dd3f38c8fc12cd32f (patch) | |
tree | 434c6e468549503e018705e5fe1a23927f2ba4c5 /src/unistd | |
parent | add getpass (diff) | |
download | slibc-80ce6dad1e3991b95692960dd3f38c8fc12cd32f.tar.gz slibc-80ce6dad1e3991b95692960dd3f38c8fc12cd32f.tar.bz2 slibc-80ce6dad1e3991b95692960dd3f38c8fc12cd32f.tar.xz |
in case environ is set to null
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to 'src/unistd')
-rw-r--r-- | src/unistd/daemonise.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/unistd/daemonise.c b/src/unistd/daemonise.c index c43f114..73ad4f8 100644 --- a/src/unistd/daemonise.c +++ b/src/unistd/daemonise.c @@ -167,7 +167,7 @@ int daemonise(const char* name, int flags) /* TODO user-private daemons */ } /* Remove malformatted environment entires. */ - if ((flags & DAEMONISE_KEEP_ENVIRON) == 0) + if (((flags & DAEMONISE_KEEP_ENVIRON) == 0) && (environ != NULL)) { for (r = w = environ; *r; r++) if (strchr(*r, '=')) /* It happens that this is not the case! (Thank you PAM!) */ |