umount: stop using excessive aounts of stack. Surprisingly,
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Sat, 10 Nov 2007 01:45:03 +0000 (01:45 +0000)
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Sat, 10 Nov 2007 01:45:03 +0000 (01:45 +0000)
code shrank a lot too

function                                             old     new   delta
umount_main                                          751     640    -111

git-svn-id: svn://busybox.net/trunk/busybox@20401 69ca8d6d-28ef-0310-b511-8ec308f3f277

util-linux/umount.c

index 7c1b813..a9d60fc 100644 (file)
@@ -25,7 +25,7 @@ int umount_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 int umount_main(int argc, char **argv)
 {
        int doForce;
-       char path[PATH_MAX + 2];
+       char *const path = xmalloc(PATH_MAX + 2); /* to save stack */
        struct mntent me;
        FILE *fp;
        char *fstype = 0;
@@ -155,6 +155,7 @@ int umount_main(int argc, char **argv)
                        free(mtl);
                        mtl = m;
                }
+               free(path);
        }
 
        return status;