tools: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/

parent 40464e8a
...@@ -302,6 +302,7 @@ lxc_freeze_SOURCES = tools/lxc_freeze.c \ ...@@ -302,6 +302,7 @@ lxc_freeze_SOURCES = tools/lxc_freeze.c \
lxc_info_SOURCES = tools/lxc_info.c \ lxc_info_SOURCES = tools/lxc_info.c \
tools/arguments.c tools/arguments.h tools/arguments.c tools/arguments.h
lxc_monitor_SOURCES = tools/lxc_monitor.c \ lxc_monitor_SOURCES = tools/lxc_monitor.c \
macro.h \
tools/arguments.c tools/arguments.h tools/arguments.c tools/arguments.h
lxc_ls_SOURCES = tools/lxc_ls.c \ lxc_ls_SOURCES = tools/lxc_ls.c \
tools/arguments.c tools/arguments.h tools/arguments.c tools/arguments.h
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include "af_unix.h" #include "af_unix.h"
#include "arguments.h" #include "arguments.h"
#include "log.h" #include "log.h"
#include "macro.h"
#include "monitor.h" #include "monitor.h"
#include "state.h" #include "state.h"
#include "utils.h" #include "utils.h"
...@@ -156,7 +157,7 @@ static int lxc_tool_monitord_spawn(const char *lxcpath) ...@@ -156,7 +157,7 @@ static int lxc_tool_monitord_spawn(const char *lxcpath)
{ {
int ret; int ret;
int pipefd[2]; int pipefd[2];
char pipefd_str[LXC_NUMSTRLEN64]; char pipefd_str[INTTYPE_TO_STRLEN(int)];
pid_t pid1, pid2; pid_t pid1, pid2;
char *const args[] = { char *const args[] = {
...@@ -223,8 +224,8 @@ static int lxc_tool_monitord_spawn(const char *lxcpath) ...@@ -223,8 +224,8 @@ static int lxc_tool_monitord_spawn(const char *lxcpath)
close(pipefd[0]); close(pipefd[0]);
ret = snprintf(pipefd_str, LXC_NUMSTRLEN64, "%d", pipefd[1]); ret = snprintf(pipefd_str, INTTYPE_TO_STRLEN(int), "%d", pipefd[1]);
if (ret < 0 || ret >= LXC_NUMSTRLEN64) { if (ret < 0 || ret >= INTTYPE_TO_STRLEN(int)) {
ERROR("Failed to create pid argument to pass to monitord"); ERROR("Failed to create pid argument to pass to monitord");
_exit(EXIT_FAILURE); _exit(EXIT_FAILURE);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment