[PATCH] build: fix mingw printing of pid

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

 



Commit c75425734 introduced a compilation failure:

../../src/access/viraccessdriverpolkit.c: In function 'virAccessDriverPolkitCheck':
../../src/access/viraccessdriverpolkit.c:137:5: error: format '%d' expects argument of type 'int', but argument 9 has type 'pid_t' [-Werror=format=]
     VIR_DEBUG("Check action '%s' for process '%d' time %lld uid %d",
     ^

Since mingw pid_t is 64 bits, it's easier to just follow what we've
done elsewhere and cast to a large enough type when printing pids.

* src/access/viraccessdriverpolkit.c (virAccessDriverPolkitCheck):
Add cast.

Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
---

Pushing under the build-breaker rule.

 src/access/viraccessdriverpolkit.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/access/viraccessdriverpolkit.c b/src/access/viraccessdriverpolkit.c
index 3136be7..89bc890 100644
--- a/src/access/viraccessdriverpolkit.c
+++ b/src/access/viraccessdriverpolkit.c
@@ -1,5 +1,5 @@
 /*
- * viraccessdriverpolkit.c: polkited access control driver
+ * viraccessdriverpolkit.c: polkitd access control driver
  *
  * Copyright (C) 2012, 2014 Red Hat, Inc.
  *
@@ -134,8 +134,8 @@ virAccessDriverPolkitCheck(virAccessManagerPtr manager ATTRIBUTE_UNUSED,
                                        &uid) < 0)
         goto cleanup;

-    VIR_DEBUG("Check action '%s' for process '%d' time %lld uid %d",
-              actionid, pid, startTime, uid);
+    VIR_DEBUG("Check action '%s' for process '%lld' time %lld uid %d",
+              actionid, (long long) pid, startTime, uid);

     rv = virPolkitCheckAuth(actionid,
                             pid,
-- 
1.9.3

--
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]

  Powered by Linux