fork(2) returns -1 on failure, not some random negative number.
MFC after: 3 days
This commit is contained in:
parent
c6791c926e
commit
dfb1aece41
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=229744
@ -886,7 +886,7 @@ hastd_primary(struct hast_resource *res)
|
||||
}
|
||||
|
||||
pid = fork();
|
||||
if (pid < 0) {
|
||||
if (pid == -1) {
|
||||
/* TODO: There's no need for this to be fatal error. */
|
||||
KEEP_ERRNO((void)pidfile_remove(pfh));
|
||||
pjdlog_exit(EX_TEMPFAIL, "Unable to fork");
|
||||
|
@ -401,7 +401,7 @@ hastd_secondary(struct hast_resource *res, struct nv *nvin)
|
||||
}
|
||||
|
||||
pid = fork();
|
||||
if (pid < 0) {
|
||||
if (pid == -1) {
|
||||
KEEP_ERRNO((void)pidfile_remove(pfh));
|
||||
pjdlog_exit(EX_OSERR, "Unable to fork");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user