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
 		} while (e);
77
 		} while (e);
78
 		free(env);
78
 		free(env);
79
 		exit(EXIT_FAILURE);
79
 		exit(EXIT_FAILURE);
80
+	} else if (pid < 0) {
81
+		fprintf(stderr, "fork() failed: %s\n", strerror(errno));
80
 	} else {
82
 	} else {
81
 		waitpid(pid, NULL, 0);
83
 		waitpid(pid, NULL, 0);
82
 	}
84
 	}

Loading…
Cancel
Save