]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cmd: s/MAXPATHLEN/PATH_MAX/g
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 7 Oct 2018 07:53:46 +0000 (09:53 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 7 Oct 2018 07:53:46 +0000 (09:53 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cmd/lxc_init.c

index c643419ea0fc53fc0cd55f801f1f2c0adb4448ec..14cc5fd6153a01ad07970688ee3115f991877ad0 100644 (file)
@@ -28,6 +28,7 @@
 #include <errno.h>
 #include <getopt.h>
 #include <libgen.h>
+#include <limits.h>
 #include <pthread.h>
 #include <signal.h>
 #include <stdio.h>
@@ -108,7 +109,7 @@ static void prevent_forking(void)
        FILE *f;
        size_t len = 0;
        char *line = NULL;
-       char path[MAXPATHLEN];
+       char path[PATH_MAX];
 
        f = fopen("/proc/self/cgroup", "r");
        if (!f)
@@ -202,10 +203,10 @@ static void remove_self(void)
 {
        int ret;
        ssize_t n;
-       char path[MAXPATHLEN] = {0};
+       char path[PATH_MAX] = {0};
 
        n = readlink("/proc/self/exe", path, sizeof(path));
-       if (n < 0 || n >= MAXPATHLEN) {
+       if (n < 0 || n >= PATH_MAX) {
                SYSDEBUG("Failed to readlink \"/proc/self/exe\"");
                return;
        }