瀏覽代碼

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

Otherwise the variable was uninitialized.
Guillem Jover 15 年之前
父節點
當前提交
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)