]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: Cast uid_t|gid_t to unsigned int
authorPhilipp Hahn <hahn@univention.de>
Fri, 22 Feb 2013 16:43:15 +0000 (17:43 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 25 Feb 2013 14:46:32 +0000 (15:46 +0100)
uid_t and gid_t are opaque types, ranging from s32 to u32 to u64.

Explicitly cast them to unsigned int for printing.

Signed-off-by: Philipp Hahn <hahn@univention.de>
src/storage/storage_backend.c

index 460b792614e75a5ab913de3e5ad6935cd36ae4d3..70bb48ae998145bfe2578701f060852a1f2b6cb4 100644 (file)
@@ -283,7 +283,8 @@ virStorageBackendCreateBlockFrom(virConnectPtr conn ATTRIBUTE_UNUSED,
         && (fchown(fd, uid, gid) < 0)) {
         virReportSystemError(errno,
                              _("cannot chown '%s' to (%u, %u)"),
-                             vol->target.path, uid, gid);
+                             vol->target.path, (unsigned int) uid,
+                             (unsigned int) gid);
         goto cleanup;
     }
     if (fchmod(fd, vol->target.perms.mode) < 0) {
@@ -577,7 +578,8 @@ static int virStorageBackendCreateExecCommand(virStoragePoolObjPtr pool,
         && (chown(vol->target.path, uid, gid) < 0)) {
         virReportSystemError(errno,
                              _("cannot chown %s to (%u, %u)"),
-                             vol->target.path, uid, gid);
+                             vol->target.path, (unsigned int) uid,
+                             (unsigned int) gid);
         return -1;
     }
     if (chmod(vol->target.path, vol->target.perms.mode) < 0) {