Skip to content

Commit

Permalink
tools: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Sep 30, 2018
1 parent d2e61e5 commit 39cc7f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/lxc/Makefile.am
Expand Up @@ -301,6 +301,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
Expand Down
7 changes: 4 additions & 3 deletions src/lxc/tools/lxc_monitor.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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[] = {
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 39cc7f5

Please sign in to comment.