[PATCH libvirt 2/3] build: fix output of pid values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix a few more places where pid_t is printed with wrong type
---
 src/conf/domain_audit.c |    4 ++--
 src/conf/domain_conf.c  |    4 ++--
 src/util/command.c      |    2 +-
 src/util/virpidfile.c   |    2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c
index b885906..653657b 100644
--- a/src/conf/domain_audit.c
+++ b/src/conf/domain_audit.c
@@ -562,8 +562,8 @@ virDomainAuditLifecycle(virDomainObjPtr vm, const char *op,
     }
 
     VIR_AUDIT(VIR_AUDIT_RECORD_MACHINE_CONTROL, success,
-              "virt=%s op=%s reason=%s %s uuid=%s vm-pid=%d",
-              virt, op, reason, vmname, uuidstr, vm->pid);
+              "virt=%s op=%s reason=%s %s uuid=%s vm-pid=%lld",
+              virt, op, reason, vmname, uuidstr, (long long)vm->pid);
 
     VIR_FREE(vmname);
 }
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index ac877f9..15a097a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -12787,10 +12787,10 @@ static char *virDomainObjFormat(virCapsPtr caps,
     int i;
 
     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),
                       virDomainStateReasonToString(state, reason),
-                      obj->pid);
+                      (long long)obj->pid);
 
     for (i = 0 ; i < VIR_DOMAIN_TAINT_LAST ; i++) {
         if (obj->taint & (1 << i))
diff --git a/src/util/command.c b/src/util/command.c
index 2837450..800ec8f 100644
--- a/src/util/command.c
+++ b/src/util/command.c
@@ -2399,7 +2399,7 @@ void
 virPidAbort(pid_t pid)
 {
     /* Not yet ported to mingw.  Any volunteers?  */
-    VIR_DEBUG("failed to reap child %d, abandoning it", pid);
+    VIR_DEBUG("failed to reap child %lldd, abandoning it", (long long)pid);
 }
 
 void
diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c
index 1934341..59d0c94 100644
--- a/src/util/virpidfile.c
+++ b/src/util/virpidfile.c
@@ -222,7 +222,7 @@ int virPidFileReadPathIfAlive(const char *path,
 #endif
 
     if (binpath) {
-        if (virAsprintf(&procpath, "/proc/%d/exe", *pid) < 0) {
+        if (virAsprintf(&procpath, "/proc/%lld/exe", (long long)*pid) < 0) {
             *pid = -1;
             return -1;
         }
-- 
1.7.10

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]