libutil/recurse: Use a single path buffer, and directory fd
This way, we don't use PATH_MAX bytes on the stack per path component, and don't have to keep copying the complete path around.
This commit is contained in:
4
rm.c
4
rm.c
@@ -1,4 +1,6 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "fs.h"
|
||||
#include "util.h"
|
||||
|
||||
@@ -34,7 +36,7 @@ main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
for (; *argv; argc--, argv++)
|
||||
recurse(*argv, NULL, &r);
|
||||
recurse(AT_FDCWD, *argv, NULL, &r);
|
||||
|
||||
return rm_status || recurse_status;
|
||||
}
|
||||
|
Reference in New Issue
Block a user