Просмотр исходного кода

s-s-d: Return status_unknown on error reading from the pid file

Otherwise the variable was uninitialized.
Guillem Jover лет назад: 15
Родитель
Сommit
2ecaea9677
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      utils/start-stop-daemon.c

+ 2 - 0
utils/start-stop-daemon.c

@@ -1243,6 +1243,8 @@ do_pidfile(const char *name)
 
 		if (fscanf(f, "%d", &pid) == 1)
 			pid_status = pid_check(pid);
+		else
+			pid_status = status_unknown;
 		fclose(f);
 
 		if (pid_status == status_dead)