svn commit: trunk/busybox/util-linux

vda at busybox.net vda at busybox.net
Sat Nov 10 01:45:03 UTC 2007


Author: vda
Date: 2007-11-09 17:45:03 -0800 (Fri, 09 Nov 2007)
New Revision: 20401

Log:
umount: stop using excessive aounts of stack. Surprisingly,
code shrank a lot too

function                                             old     new   delta
umount_main                                          751     640    -111



Modified:
   trunk/busybox/util-linux/umount.c


Changeset:
Modified: trunk/busybox/util-linux/umount.c
===================================================================
--- trunk/busybox/util-linux/umount.c	2007-11-10 01:35:47 UTC (rev 20400)
+++ trunk/busybox/util-linux/umount.c	2007-11-10 01:45:03 UTC (rev 20401)
@@ -25,7 +25,7 @@
 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 @@
 			free(mtl);
 			mtl = m;
 		}
+		free(path);
 	}
 
 	return status;




More information about the busybox-cvs mailing list