fork(2) returns -1 on failure, not some random negative number.

MFC after:	3 days
This commit is contained in:
Pawel Jakub Dawidek 2012-01-06 23:44:26 +00:00
parent c6791c926e
commit dfb1aece41
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=229744
2 changed files with 2 additions and 2 deletions

View File

@ -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");

View File

@ -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");
}