#include "conf.h"
#include "config.h"
#include "log.h"
+#include "macro.h"
#include "network.h"
#include "nl.h"
#include "utils.h"
if (child == 0) {
int ret;
size_t retlen;
- char pidstr[LXC_NUMSTRLEN64];
+ char pidstr[INTTYPE_TO_STRLEN(pid_t)];
close(pipefd[0]);
_exit(EXIT_FAILURE);
}
- ret = snprintf(pidstr, LXC_NUMSTRLEN64, "%d", pid);
- if (ret < 0 || ret >= LXC_NUMSTRLEN64)
+ ret = snprintf(pidstr, sizeof(pidstr), "%d", pid);
+ if (ret < 0 || ret >= sizeof(pidstr))
_exit(EXIT_FAILURE);
- pidstr[LXC_NUMSTRLEN64 - 1] = '\0';
+ pidstr[sizeof(pidstr) - 1] = '\0';
INFO("Execing lxc-user-nic create %s %s %s veth %s %s", lxcpath,
lxcname, pidstr, netdev_link,
struct lxc_list *network = &handler->conf->network;
/* strlen("/proc/") = 6
* +
- * LXC_NUMSTRLEN64
+ * INTTYPE_TO_STRLEN(pid_t)
* +
* strlen("/fd/") = 4
* +
- * LXC_NUMSTRLEN64
+ * INTTYPE_TO_STRLEN(int)
* +
* \0
*/
- char netns_path[6 + LXC_NUMSTRLEN64 + 4 + LXC_NUMSTRLEN64 + 1];
+ char netns_path[6 + INTTYPE_TO_STRLEN(pid_t) + 4 + INTTYPE_TO_STRLEN(int) + 1];
*netns_path = '\0';