]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tools: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 25 Aug 2018 10:27:10 +0000 (12:27 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 28 Aug 2018 18:22:24 +0000 (20:22 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/Makefile.am
src/lxc/tools/lxc_monitor.c

index 266b2a36a4ceb7c49e56f91a9709874db81526d2..9499d51218254f8835340b07c09f8ff964b0bcca 100644 (file)
@@ -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
index df4d00f422ca073a7cf37107071ccaf8104ac91c..5e296082e6e6a7cb34b0eea4c4193fc67448d397 100644 (file)
@@ -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);
        }