Replace MAXPATHLEN with PATH_MAX
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.
diff --git a/strace.c b/strace.c
index cb96758..aae7505 100644
--- a/strace.c
+++ b/strace.c
@@ -1161,7 +1161,7 @@
{
struct_stat statbuf;
const char *filename;
- char pathname[MAXPATHLEN];
+ char pathname[PATH_MAX];
int pid;
struct tcb *tcp;
@@ -1195,7 +1195,7 @@
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 @@
* 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 e05efcd..4f637e8 100644
--- a/util.c
+++ b/util.c
@@ -598,7 +598,7 @@
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 @@
printpath(struct tcb *tcp, long addr)
{
/* Size must correspond to char path[] size in printpathn */
- printpathn(tcp, addr, MAXPATHLEN);
+ printpathn(tcp, addr, PATH_MAX);
}
/*