Commit b4c1e35d by Stéphane Graber

Cast to gid_t to fix android build failure

stat.st_gid is unsigned long in bionic instead of the expected gid_t, so just cast it to gid_t. Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent 8b227008
...@@ -3602,8 +3602,8 @@ int chown_mapped_root(char *path, struct lxc_conf *conf) ...@@ -3602,8 +3602,8 @@ int chown_mapped_root(char *path, struct lxc_conf *conf)
} }
// "g:pathgid:rootgid+pathgid:1" // "g:pathgid:rootgid+pathgid:1"
ret = snprintf(map4, 100, "g:%d:%d:1", sb.st_gid, ret = snprintf(map4, 100, "g:%d:%d:1", (gid_t)sb.st_gid,
rootgid + sb.st_gid); rootgid + (gid_t)sb.st_gid);
if (ret < 0 || ret >= 100) { if (ret < 0 || ret >= 100) {
ERROR("Error gid printing map string"); ERROR("Error gid printing map string");
return -1; return -1;
...@@ -3617,7 +3617,7 @@ int chown_mapped_root(char *path, struct lxc_conf *conf) ...@@ -3617,7 +3617,7 @@ int chown_mapped_root(char *path, struct lxc_conf *conf)
} }
// "0:pathgid" (chown) // "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) { if (ret < 0 || ret >= 100) {
ERROR("Error owner printing format string for chown"); ERROR("Error owner printing format string for chown");
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment