From ac033652fe384da13cfae1b3791c1488c4a59f8c Mon Sep 17 00:00:00 2001 From: sin Date: Mon, 7 Oct 2013 16:37:23 +0100 Subject: [PATCH] Do not return 0 on error for setsid(1) --- setsid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setsid.c b/setsid.c index 796f8d7..2e17540 100644 --- a/setsid.c +++ b/setsid.c @@ -1,5 +1,6 @@ /* (C)opyright MMVI Anselm R. Garbe * See LICENSE file for license details. */ +#include #include #include #include @@ -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; }