utils: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/

parent 70025c17
...@@ -1150,7 +1150,7 @@ int lxc_mount_proc_if_needed(const char *rootfs) ...@@ -1150,7 +1150,7 @@ int lxc_mount_proc_if_needed(const char *rootfs)
{ {
char path[MAXPATHLEN]; char path[MAXPATHLEN];
int link_to_pid, linklen, mypid, ret; int link_to_pid, linklen, mypid, ret;
char link[LXC_NUMSTRLEN64] = {0}; char link[INTTYPE_TO_STRLEN(pid_t)] = {0};
ret = snprintf(path, MAXPATHLEN, "%s/proc/self", rootfs); ret = snprintf(path, MAXPATHLEN, "%s/proc/self", rootfs);
if (ret < 0 || ret >= MAXPATHLEN) { if (ret < 0 || ret >= MAXPATHLEN) {
...@@ -1158,7 +1158,7 @@ int lxc_mount_proc_if_needed(const char *rootfs) ...@@ -1158,7 +1158,7 @@ int lxc_mount_proc_if_needed(const char *rootfs)
return -1; return -1;
} }
linklen = readlink(path, link, LXC_NUMSTRLEN64); linklen = readlink(path, link, INTTYPE_TO_STRLEN(pid_t));
ret = snprintf(path, MAXPATHLEN, "%s/proc", rootfs); ret = snprintf(path, MAXPATHLEN, "%s/proc", rootfs);
if (ret < 0 || ret >= MAXPATHLEN) { if (ret < 0 || ret >= MAXPATHLEN) {
...@@ -1172,7 +1172,7 @@ int lxc_mount_proc_if_needed(const char *rootfs) ...@@ -1172,7 +1172,7 @@ int lxc_mount_proc_if_needed(const char *rootfs)
return -1; return -1;
goto domount; goto domount;
} else if (linklen >= LXC_NUMSTRLEN64) { } else if (linklen >= INTTYPE_TO_STRLEN(pid_t)) {
link[linklen - 1] = '\0'; link[linklen - 1] = '\0';
ERROR("readlink returned truncated content: \"%s\"", link); ERROR("readlink returned truncated content: \"%s\"", link);
return -1; return -1;
...@@ -1253,7 +1253,7 @@ int null_stdfds(void) ...@@ -1253,7 +1253,7 @@ int null_stdfds(void)
/* Check whether a signal is blocked by a process. */ /* Check whether a signal is blocked by a process. */
/* /proc/pid-to-str/status\0 = (5 + 21 + 7 + 1) */ /* /proc/pid-to-str/status\0 = (5 + 21 + 7 + 1) */
#define __PROC_STATUS_LEN (6 + (LXC_NUMSTRLEN64) + 7 + 1) #define __PROC_STATUS_LEN (6 + INTTYPE_TO_STRLEN(pid_t) + 7 + 1)
bool task_blocks_signal(pid_t pid, int signal) bool task_blocks_signal(pid_t pid, int signal)
{ {
int ret; int ret;
......
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