]> granicus.if.org Git - strace/commitdiff
Replace MAXPATHLEN with PATH_MAX
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 21 Nov 2014 22:28:34 +0000 (22:28 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 21 Nov 2014 22:28:34 +0000 (22:28 +0000)
MAXPATHLEN is defined to PATH_MAX, so replace the former with the latter.

* strace.c (startup_child): Replace MAXPATHLEN with PATH_MAX.
* util.c (printpathn, printpath): Likewise.

strace.c
util.c

index cb9675856fda13360e735e50a2347a83397ffe3f..aae7505f4e47c4d3f71b7030feb2f6bdb5fcf33e 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -1161,7 +1161,7 @@ startup_child(char **argv)
 {
        struct_stat statbuf;
        const char *filename;
-       char pathname[MAXPATHLEN];
+       char pathname[PATH_MAX];
        int pid;
        struct tcb *tcp;
 
@@ -1195,7 +1195,7 @@ startup_child(char **argv)
                        else
                                m = n = strlen(path);
                        if (n == 0) {
-                               if (!getcwd(pathname, MAXPATHLEN))
+                               if (!getcwd(pathname, PATH_MAX))
                                        continue;
                                len = strlen(pathname);
                        }
@@ -1308,7 +1308,7 @@ startup_child(char **argv)
                 * instead of call (won't push anything to stack),
                 * (2) by trying very hard in exec_or_die()
                 * to not use any stack,
-                * (3) having a really big (MAXPATHLEN) stack object
+                * (3) having a really big (PATH_MAX) stack object
                 * in this function, which creates a "buffer" between
                 * child's and parent's stack pointers.
                 * This may save us if (1) and (2) failed
diff --git a/util.c b/util.c
index e05efcd80cbc16f4add6e3c636a0986cbddf76ef..4f637e839921879026224de260035748c000ea06 100644 (file)
--- a/util.c
+++ b/util.c
@@ -598,7 +598,7 @@ string_quote(const char *instr, char *outstr, long len, int size)
 void
 printpathn(struct tcb *tcp, long addr, unsigned int n)
 {
-       char path[MAXPATHLEN + 1];
+       char path[PATH_MAX + 1];
        int nul_seen;
 
        if (!addr) {
@@ -631,7 +631,7 @@ void
 printpath(struct tcb *tcp, long addr)
 {
        /* Size must correspond to char path[] size in printpathn */
-       printpathn(tcp, addr, MAXPATHLEN);
+       printpathn(tcp, addr, PATH_MAX);
 }
 
 /*