From f03280a7609a24f9003472af3e5f6dd1244c5033 Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Tue, 15 Mar 2016 12:01:36 -0600 Subject: [PATCH] build: fix build on android (and ppc) The problem here is that dev_t on most platforms is `long unsigned`, but on android (and ppc?) it's `long long unsigned`. Let's just upcast to `long long unsigned` and use that format string to keep the compilers happy. Safety first! Signed-off-by: Tycho Andersen --- src/lxc/criu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lxc/criu.c b/src/lxc/criu.c index c83845e7a..a745806a5 100644 --- a/src/lxc/criu.c +++ b/src/lxc/criu.c @@ -732,7 +732,9 @@ static int save_tty_major_minor(char *directory, struct lxc_container *c, char * return -1; } - ret = snprintf(tty_id, len, "tty[%lx:%lx]", sb.st_rdev, sb.st_dev); + ret = snprintf(tty_id, len, "tty[%llx:%llx]", + (long long unsigned) sb.st_rdev, + (long long unsigned) sb.st_dev); if (ret < 0 || ret >= sizeof(path)) { ERROR("snprintf'd too many characters: %d", ret); return -1; -- 2.47.2