[git commit master 1/1] umount: do not (ab)use PATH_MAX as mntent buffer size

Denys Vlasenko vda.linux at googlemail.com
Sun Oct 24 01:00:57 UTC 2010


commit: http://git.busybox.net/busybox/commit/?id=07b1c6ecc035c5b4d68db6b676610327bb897418
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 util-linux/umount.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/util-linux/umount.c b/util-linux/umount.c
index 7ba46ee..1b489ba 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -39,9 +39,6 @@
 # define MS_RELATIME    (1 << 21)
 #endif
 #include "libbb.h"
-#ifndef PATH_MAX
-# define PATH_MAX (4*1024)
-#endif
 
 
 #if defined(__dietlibc__)
@@ -73,7 +70,7 @@ int umount_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 int umount_main(int argc UNUSED_PARAM, char **argv)
 {
 	int doForce;
-	char *const buf = xmalloc(PATH_MAX * 2 + 128); /* to save stack */
+	char *const buf = xmalloc(4096); /* reducing stack usage */
 	struct mntent me;
 	FILE *fp;
 	char *fstype = NULL;
-- 
1.7.1



More information about the busybox-cvs mailing list