umount: do not (ab)use PATH_MAX as mntent buffer size
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 24 Oct 2010 01:00:57 +0000 (03:00 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 24 Oct 2010 01:00:57 +0000 (03:00 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
util-linux/umount.c

index 7ba46eeb011c44fecb65d465d79f6634310b9a84..1b489ba5630b06576df951c171f748f4ccfb220c 100644 (file)
@@ -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;