forked from github/abduco
Exit if changing to root directory fails
This commit is contained in:
parent
32a839d76a
commit
5bf6b3178b
3
abduco.c
3
abduco.c
|
|
@ -463,7 +463,8 @@ static bool create_session(const char *name, char * const argv[]) {
|
||||||
sa.sa_handler = SIG_IGN;
|
sa.sa_handler = SIG_IGN;
|
||||||
sigaction(SIGPIPE, &sa, NULL);
|
sigaction(SIGPIPE, &sa, NULL);
|
||||||
sigaction(SIGHUP, &sa, NULL);
|
sigaction(SIGHUP, &sa, NULL);
|
||||||
chdir("/");
|
if (chdir("/") == -1)
|
||||||
|
_exit(EXIT_FAILURE);
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
int fd = open("/dev/null", O_RDWR);
|
int fd = open("/dev/null", O_RDWR);
|
||||||
if (fd != -1) {
|
if (fd != -1) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue