Author: pjd
Date: Fri Jan  6 23:44:26 2012
New Revision: 229744
URL: http://svn.freebsd.org/changeset/base/229744

Log:
  fork(2) returns -1 on failure, not some random negative number.
  
  MFC after:    3 days

Modified:
  head/sbin/hastd/primary.c
  head/sbin/hastd/secondary.c

Modified: head/sbin/hastd/primary.c
==============================================================================
--- head/sbin/hastd/primary.c   Fri Jan  6 23:33:33 2012        (r229743)
+++ head/sbin/hastd/primary.c   Fri Jan  6 23:44:26 2012        (r229744)
@@ -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");

Modified: head/sbin/hastd/secondary.c
==============================================================================
--- head/sbin/hastd/secondary.c Fri Jan  6 23:33:33 2012        (r229743)
+++ head/sbin/hastd/secondary.c Fri Jan  6 23:44:26 2012        (r229744)
@@ -401,7 +401,7 @@ hastd_secondary(struct hast_resource *re
        }
 
        pid = fork();
-       if (pid < 0) {
+       if (pid == -1) {
                KEEP_ERRNO((void)pidfile_remove(pfh));
                pjdlog_exit(EX_OSERR, "Unable to fork");
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to