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.
This commit is contained in:
parent
5b88608b29
commit
025b3581ae
6
strace.c
6
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
|
||||
|
4
util.c
4
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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user