Avoid more gcc warning about not checking return values ...

This commit is contained in:
Roy Marples
2009-04-30 19:56:43 +01:00
parent 21e45e895c
commit 3d0e5175d8
4 changed files with 21 additions and 12 deletions

View File

@@ -960,9 +960,9 @@ start_stop_daemon(int argc, char **argv)
if (interpreted && !pidfile) {
fp = fopen(exec_file, "r");
if (fp) {
fgets(line, sizeof(line), fp);
p = fgets(line, sizeof(line), fp);
fclose(fp);
if (line[0] == '#' && line[1] == '!') {
if (p != NULL && line[0] == '#' && line[1] == '!') {
p = line + 2;
/* Strip leading spaces */
while (*p == ' ' || *p == '\t')