Skip to content

Commit 3364df9

Browse files
committed
catch daemon() errors
1 parent f74b32c commit 3364df9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/hdapsd.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,10 @@ int main (int argc, char** argv)
11391139
return 1;
11401140
}
11411141
}
1142-
daemon(0,0);
1142+
if (daemon(0,0) != 0) {
1143+
printlog (stderr, "Failed to daemonize");
1144+
return 1;
1145+
}
11431146
if (pidfile) {
11441147
char buf[BUF_LEN];
11451148
snprintf (buf, sizeof(buf), "%d\n", getpid());

0 commit comments

Comments
 (0)