diff --git a/include/haproxy/limits.h b/include/haproxy/limits.h index 0185baf92..c512e4c7b 100644 --- a/include/haproxy/limits.h +++ b/include/haproxy/limits.h @@ -19,12 +19,12 @@ extern unsigned int rlim_fd_max_at_boot; * returns the limit, useful to print limit values as strings in err messages * via LIM2A macros. */ -static inline ulong normalize_rlim(ulong rlim) +static inline ulong normalize_rlim(rlim_t rlim) { if (rlim == RLIM_INFINITY) return 0; - return rlim; + return (ulong)rlim; } /* handlers to compute internal process limits, if they are not provided via diff --git a/src/debug.c b/src/debug.c index cb33cf0b2..2987d36ef 100644 --- a/src/debug.c +++ b/src/debug.c @@ -636,23 +636,23 @@ static int debug_parse_cli_show_dev(char **args, char *payload, struct appctx *a #endif chunk_appendf(&trash, " boot limits:\n"); chunk_appendf(&trash, " \tfd limit (soft): %s\n", - LIM2A(normalize_rlim((ulong)post_mortem.process.boot_lim_fd.rlim_cur), "unlimited")); + LIM2A(normalize_rlim(post_mortem.process.boot_lim_fd.rlim_cur), "unlimited")); chunk_appendf(&trash, " \tfd limit (hard): %s\n", - LIM2A(normalize_rlim((ulong)post_mortem.process.boot_lim_fd.rlim_max), "unlimited")); + LIM2A(normalize_rlim(post_mortem.process.boot_lim_fd.rlim_max), "unlimited")); chunk_appendf(&trash, " \tram limit (soft): %s\n", - LIM2A(normalize_rlim((ulong)post_mortem.process.boot_lim_ram.rlim_cur), "unlimited")); + LIM2A(normalize_rlim(post_mortem.process.boot_lim_ram.rlim_cur), "unlimited")); chunk_appendf(&trash, " \tram limit (hard): %s\n", - LIM2A(normalize_rlim((ulong)post_mortem.process.boot_lim_ram.rlim_max), "unlimited")); + LIM2A(normalize_rlim(post_mortem.process.boot_lim_ram.rlim_max), "unlimited")); chunk_appendf(&trash, " runtime limits:\n"); chunk_appendf(&trash, " \tfd limit (soft): %s\n", - LIM2A(normalize_rlim((ulong)post_mortem.process.run_lim_fd.rlim_cur), "unlimited")); + LIM2A(normalize_rlim(post_mortem.process.run_lim_fd.rlim_cur), "unlimited")); chunk_appendf(&trash, " \tfd limit (hard): %s\n", - LIM2A(normalize_rlim((ulong)post_mortem.process.run_lim_fd.rlim_max), "unlimited")); + LIM2A(normalize_rlim(post_mortem.process.run_lim_fd.rlim_max), "unlimited")); chunk_appendf(&trash, " \tram limit (soft): %s\n", - LIM2A(normalize_rlim((ulong)post_mortem.process.run_lim_ram.rlim_cur), "unlimited")); + LIM2A(normalize_rlim(post_mortem.process.run_lim_ram.rlim_cur), "unlimited")); chunk_appendf(&trash, " \tram limit (hard): %s\n", - LIM2A(normalize_rlim((ulong)post_mortem.process.run_lim_ram.rlim_max), "unlimited")); + LIM2A(normalize_rlim(post_mortem.process.run_lim_ram.rlim_max), "unlimited")); return cli_msg(appctx, LOG_INFO, trash.area); }