]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Cast to gid_t to fix android build failure
authorStéphane Graber <stgraber@ubuntu.com>
Mon, 30 Jun 2014 17:08:48 +0000 (13:08 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 30 Jun 2014 19:19:30 +0000 (15:19 -0400)
stat.st_gid is unsigned long in bionic instead of the expected gid_t, so
just cast it to gid_t.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/conf.c

index fcfe2573b1b576de3dc2b6cc380f47934987e9d0..bdd623a7f1e1403c1c7932cfcbd2ca6eb56766e4 100644 (file)
@@ -3593,8 +3593,8 @@ int chown_mapped_root(char *path, struct lxc_conf *conf)
                }
 
                // "g:pathgid:rootgid+pathgid:1"
-               ret = snprintf(map4, 100, "g:%d:%d:1", sb.st_gid,
-                               rootgid + sb.st_gid);
+               ret = snprintf(map4, 100, "g:%d:%d:1", (gid_t)sb.st_gid,
+                               rootgid + (gid_t)sb.st_gid);
                if (ret < 0 || ret >= 100) {
                        ERROR("Error gid printing map string");
                        return -1;
@@ -3608,7 +3608,7 @@ int chown_mapped_root(char *path, struct lxc_conf *conf)
                }
 
                // "0:pathgid" (chown)
-               ret = snprintf(ugid, 100, "0:%d", sb.st_gid);
+               ret = snprintf(ugid, 100, "0:%d", (gid_t)sb.st_gid);
                if (ret < 0 || ret >= 100) {
                        ERROR("Error owner printing format string for chown");
                        return -1;