svn commit: trunk/busybox/util-linux

landley at busybox.net landley at busybox.net
Tue Dec 20 17:18:04 UTC 2005


Author: landley
Date: 2005-12-20 09:18:01 -0800 (Tue, 20 Dec 2005)
New Revision: 12959

Log:
Some minor cleanups/bugfixes split off from the big remount work:
  Shorten GPL boilerplate.
  Enabling FEATURE_CLEAN_UP broke things in two places.
  Move the NFS with uClibc check to nfsmount.c



Modified:
   trunk/busybox/util-linux/mount.c
   trunk/busybox/util-linux/nfsmount.c


Changeset:
Modified: trunk/busybox/util-linux/mount.c
===================================================================
--- trunk/busybox/util-linux/mount.c	2005-12-20 15:25:25 UTC (rev 12958)
+++ trunk/busybox/util-linux/mount.c	2005-12-20 17:18:01 UTC (rev 12959)
@@ -6,20 +6,7 @@
  * Copyright (C) 1999-2004 by Erik Andersen <andersen at codepoet.org>
  * Copyright (C) 2005 by Rob Landley <rob at landley.net>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  */
 
 #include <limits.h>
@@ -35,12 +22,6 @@
 #include <sys/ioctl.h>  // for CONFIG_FEATURE_MOUNT_LOOP
 #include "busybox.h"
 
-/* This is just a warning of a common mistake.  Possibly this should be a
- * uclibc faq entry rather than in busybox... */
-#if ENABLE_FEATURE_MOUNT_NFS && defined(__UCLIBC__) && ! defined(__UCLIBC_HAS_RPC__)
-#error "You need to build uClibc with UCLIBC_HAS_RPC for busybox mount with NFS support to compile."
-#endif
-
 // These two aren't always defined in old headers
 #ifndef MS_BIND
 #define MS_BIND		4096
@@ -182,7 +163,7 @@
 		while (getmntent_r(mountTable,&m,path,sizeof(path))) {
 			blockDevice = m.mnt_fsname;
 
-			// Clean up display a little bit regarding root devie
+			// Clean up display a little bit regarding root device
 			if(!strcmp(blockDevice, "rootfs")) continue;
 			if(!strcmp(blockDevice, "/dev/root"))
 				blockDevice = find_block_device("/");
@@ -260,7 +241,7 @@
 			free(blockDevice);
 			blockDevice=strdup(m.mnt_fsname);
 			free(directory);
-			directory=strdup(m.mnt_type);
+			directory=strdup(m.mnt_dir);
 		} else {
 			blockDevice=m.mnt_fsname;
 			directory=m.mnt_dir;
@@ -387,16 +368,16 @@
 				bb_error_msg_and_die(bb_msg_perm_denied_are_you_root);
 		}
 		// We couldn't free this earlier becase fsType could be in buf.
-		if(ENABLE_FEATURE_CLEAN_UP) {
-			free(buf);
-			free(blockDevice);
-			free(directory);
-		}
+		if(ENABLE_FEATURE_CLEAN_UP) free(buf);
 		if(!all) break;
 	}
 
 	if(file) endmntent(file);
 	if(rc) bb_perror_msg("Mounting %s on %s failed", blockDevice, directory);
+	if(ENABLE_FEATURE_CLEAN_UP) {
+		free(blockDevice);
+		free(directory);
+	}
 
 	return rc;
 }

Modified: trunk/busybox/util-linux/nfsmount.c
===================================================================
--- trunk/busybox/util-linux/nfsmount.c	2005-12-20 15:25:25 UTC (rev 12958)
+++ trunk/busybox/util-linux/nfsmount.c	2005-12-20 17:18:01 UTC (rev 12959)
@@ -52,7 +52,13 @@
 #include <rpc/pmap_clnt.h>
 #include "nfsmount.h"
 
+/* This is just a warning of a common mistake.  Possibly this should be a
+ *  * uclibc faq entry rather than in busybox... */
+#if ENABLE_FEATURE_MOUNT_NFS && defined(__UCLIBC__) && ! defined(__UCLIBC_HAS_RPC__)
+#error "You need to build uClibc with UCLIBC_HAS_RPC for NFS support."
+#endif
 
+
 /*
  * NFS stats. The good thing with these values is that NFSv3 errors are
  * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which




More information about the busybox-cvs mailing list