提交 f065174e 编写于 作者: M Marc-André Lureau 提交者: Cole Robinson

build: fix output of pid values

Fix a few more places where pid_t is printed with wrong type
(cherry picked from commit ca1bf4bd)
上级 763f71e5
...@@ -562,8 +562,8 @@ virDomainAuditLifecycle(virDomainObjPtr vm, const char *op, ...@@ -562,8 +562,8 @@ virDomainAuditLifecycle(virDomainObjPtr vm, const char *op,
} }
VIR_AUDIT(VIR_AUDIT_RECORD_MACHINE_CONTROL, success, VIR_AUDIT(VIR_AUDIT_RECORD_MACHINE_CONTROL, success,
"virt=%s op=%s reason=%s %s uuid=%s vm-pid=%d", "virt=%s op=%s reason=%s %s uuid=%s vm-pid=%lld",
virt, op, reason, vmname, uuidstr, vm->pid); virt, op, reason, vmname, uuidstr, (long long)vm->pid);
VIR_FREE(vmname); VIR_FREE(vmname);
} }
......
...@@ -12787,10 +12787,10 @@ static char *virDomainObjFormat(virCapsPtr caps, ...@@ -12787,10 +12787,10 @@ static char *virDomainObjFormat(virCapsPtr caps,
int i; int i;
state = virDomainObjGetState(obj, &reason); state = virDomainObjGetState(obj, &reason);
virBufferAsprintf(&buf, "<domstatus state='%s' reason='%s' pid='%d'>\n", virBufferAsprintf(&buf, "<domstatus state='%s' reason='%s' pid='%lld'>\n",
virDomainStateTypeToString(state), virDomainStateTypeToString(state),
virDomainStateReasonToString(state, reason), virDomainStateReasonToString(state, reason),
obj->pid); (long long)obj->pid);
for (i = 0 ; i < VIR_DOMAIN_TAINT_LAST ; i++) { for (i = 0 ; i < VIR_DOMAIN_TAINT_LAST ; i++) {
if (obj->taint & (1 << i)) if (obj->taint & (1 << i))
......
...@@ -2399,7 +2399,7 @@ void ...@@ -2399,7 +2399,7 @@ void
virPidAbort(pid_t pid) virPidAbort(pid_t pid)
{ {
/* Not yet ported to mingw. Any volunteers? */ /* Not yet ported to mingw. Any volunteers? */
VIR_DEBUG("failed to reap child %d, abandoning it", pid); VIR_DEBUG("failed to reap child %lld, abandoning it", (long long)pid);
} }
void void
......
...@@ -222,7 +222,7 @@ int virPidFileReadPathIfAlive(const char *path, ...@@ -222,7 +222,7 @@ int virPidFileReadPathIfAlive(const char *path,
#endif #endif
if (binpath) { if (binpath) {
if (virAsprintf(&procpath, "/proc/%d/exe", *pid) < 0) { if (virAsprintf(&procpath, "/proc/%lld/exe", (long long)*pid) < 0) {
*pid = -1; *pid = -1;
return -1; return -1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册