]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
build: fix build on android (and ppc) 895/head
authorTycho Andersen <tycho.andersen@canonical.com>
Tue, 15 Mar 2016 18:01:36 +0000 (12:01 -0600)
committerTycho Andersen <tycho.andersen@canonical.com>
Tue, 15 Mar 2016 18:01:36 +0000 (12:01 -0600)
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 <tycho.andersen@canonical.com>
src/lxc/criu.c

index c83845e7a86c18c6f0985de81d97b2f6de0c64ef..a745806a54db9c0536b2a6cfabe49f80cec55681 100644 (file)
@@ -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;