Do not return 0 on error for setsid(1)

This commit is contained in:
sin 2013-10-07 16:37:23 +01:00
parent bf17657544
commit ac033652fe

View File

@ -1,5 +1,6 @@
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details. */
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@ -37,6 +38,5 @@ main(int argc, char *argv[])
eprintf("setsid:");
execvp(argv[0], argv);
eprintf("execvp:");
/* NOTREACHED */
return 0;
return (errno == ENOENT) ? 127 : 126;
}