Do not return 0 on error for setsid(1)
This commit is contained in:
parent
bf17657544
commit
ac033652fe
4
setsid.c
4
setsid.c
@ -1,5 +1,6 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details. */
|
* See LICENSE file for license details. */
|
||||||
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -37,6 +38,5 @@ main(int argc, char *argv[])
|
|||||||
eprintf("setsid:");
|
eprintf("setsid:");
|
||||||
execvp(argv[0], argv);
|
execvp(argv[0], argv);
|
||||||
eprintf("execvp:");
|
eprintf("execvp:");
|
||||||
/* NOTREACHED */
|
return (errno == ENOENT) ? 127 : 126;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user