Backport: Fix: rlim_cur and rlim_max printing causes a warning on some archs
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 6 Jul 2018 20:07:12 +0000 (16:07 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 6 Jul 2018 23:17:47 +0000 (19:17 -0400)
rlim_cur and rlim_max were assumed to be unsigned longs, but they
are explicitly 64-bits long on 32 bits archs (warning seen for
powerpc 32 and arm 32 builds).

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/main.c

index 107ea14e113fe4ba500ab21c2229fe2ef375fd5e..87a22c525d0553e2d0df91d2743c1f9c88f9d939 100644 (file)
@@ -460,13 +460,14 @@ static int set_fd_pool_size(void)
                goto end;
        }
 
-       DBG("File descriptor count limits are %lu (soft) and %lu (hard)",
-                       rlimit.rlim_cur, rlimit.rlim_max);
+       DBG("File descriptor count limits are %" PRIu64 " (soft) and %" PRIu64 " (hard)",
+                       (uint64_t) rlimit.rlim_cur, (uint64_t) rlimit.rlim_max);
        if (lttng_opt_fd_pool_size == -1) {
                /* Use default value (soft limit - reserve). */
                if (rlimit.rlim_cur < DEFAULT_RELAYD_MIN_FD_POOL_SIZE) {
-                       ERR("The process' file number limit is too low (%lu). The process' file number limit must be set to at least %i.",
-                                       rlimit.rlim_cur, DEFAULT_RELAYD_MIN_FD_POOL_SIZE);
+                       ERR("The process' file number limit is too low (%" PRIu64 "). The process' file number limit must be set to at least %i.",
+                                       (uint64_t) rlimit.rlim_cur,
+                                       DEFAULT_RELAYD_MIN_FD_POOL_SIZE);
                        ret = -1;
                        goto end;
                }
This page took 0.02839 seconds and 5 git commands to generate.