Explorar o código

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

Otherwise the variable was uninitialized.
Guillem Jover %!s(int64=15) %!d(string=hai) anos
pai
achega
2ecaea9677
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  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)