From: Christian Brauner Date: Sat, 25 Aug 2018 10:27:10 +0000 (+0200) Subject: tools: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/ X-Git-Tag: lxc-3.1.0~127^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d6ade4ace278fa7c4ae59342237debe1a6f9c45;p=thirdparty%2Flxc.git tools: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/ Signed-off-by: Christian Brauner --- diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am index 266b2a36a..9499d5121 100644 --- a/src/lxc/Makefile.am +++ b/src/lxc/Makefile.am @@ -302,6 +302,7 @@ lxc_freeze_SOURCES = tools/lxc_freeze.c \ lxc_info_SOURCES = tools/lxc_info.c \ tools/arguments.c tools/arguments.h lxc_monitor_SOURCES = tools/lxc_monitor.c \ + macro.h \ tools/arguments.c tools/arguments.h lxc_ls_SOURCES = tools/lxc_ls.c \ tools/arguments.c tools/arguments.h diff --git a/src/lxc/tools/lxc_monitor.c b/src/lxc/tools/lxc_monitor.c index df4d00f42..5e296082e 100644 --- a/src/lxc/tools/lxc_monitor.c +++ b/src/lxc/tools/lxc_monitor.c @@ -47,6 +47,7 @@ #include "af_unix.h" #include "arguments.h" #include "log.h" +#include "macro.h" #include "monitor.h" #include "state.h" #include "utils.h" @@ -156,7 +157,7 @@ static int lxc_tool_monitord_spawn(const char *lxcpath) { int ret; int pipefd[2]; - char pipefd_str[LXC_NUMSTRLEN64]; + char pipefd_str[INTTYPE_TO_STRLEN(int)]; pid_t pid1, pid2; char *const args[] = { @@ -223,8 +224,8 @@ static int lxc_tool_monitord_spawn(const char *lxcpath) close(pipefd[0]); - ret = snprintf(pipefd_str, LXC_NUMSTRLEN64, "%d", pipefd[1]); - if (ret < 0 || ret >= LXC_NUMSTRLEN64) { + ret = snprintf(pipefd_str, INTTYPE_TO_STRLEN(int), "%d", pipefd[1]); + if (ret < 0 || ret >= INTTYPE_TO_STRLEN(int)) { ERROR("Failed to create pid argument to pass to monitord"); _exit(EXIT_FAILURE); }