Browse Source

notify: Handle fork() failure.

Georgi Chorbadzhiyski 12 years ago
parent
commit
a0c257e25b
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      notify.c

+ 2
- 0
notify.c View File

@@ -77,6 +77,8 @@ static void *do_notify(void *in) {
77 77
 		} while (e);
78 78
 		free(env);
79 79
 		exit(EXIT_FAILURE);
80
+	} else if (pid < 0) {
81
+		fprintf(stderr, "fork() failed: %s\n", strerror(errno));
80 82
 	} else {
81 83
 		waitpid(pid, NULL, 0);
82 84
 	}

Loading…
Cancel
Save