提交 c811de8f 编写于 作者: E Eric Blake

build: fix virpidfile on mingw

Regression introduced in commit b7e5ca48.

Mingw lacks kill(), but we were only using it for a sanity check;
so we can go with one less check.

Also, on OOM error, this function should outright fail rather than
claim that the pid file was successfully read.

* src/util/virpidfile.c (virPidFileReadPathIfAlive): Skip kill
call where unsupported, and report error on OOM.
上级 984840a2
......@@ -200,15 +200,18 @@ int virPidFileReadPathIfAlive(const char *path,
if (rc < 0)
return rc;
/* Check that it's still alive */
#ifndef WIN32
/* Check that it's still alive. Safe to skip this sanity check on
* mingw, which lacks kill(). */
if (kill(*pid, 0) < 0) {
*pid = -1;
return 0;
}
#endif
if (virAsprintf(&procpath, "/proc/%d/exe", *pid) < 0) {
*pid = -1;
return 0;
return -1;
}
if (virFileIsLink(procpath) &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册