]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: fix mingw printing of pid
authorEric Blake <eblake@redhat.com>
Mon, 8 Dec 2014 21:56:31 +0000 (14:56 -0700)
committerEric Blake <eblake@redhat.com>
Mon, 8 Dec 2014 22:01:24 +0000 (15:01 -0700)
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@redhat.com>
src/access/viraccessdriverpolkit.c

index 3136be7ea01c828125039367c535a162484e1281..89bc8908f234d2424b360f76dcd39f229a615949 100644 (file)
@@ -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,