svn commit: trunk/busybox: include miscutils util-linux

landley at busybox.net landley at busybox.net
Thu Jun 15 15:49:41 UTC 2006


Author: landley
Date: 2006-06-15 08:49:36 -0700 (Thu, 15 Jun 2006)
New Revision: 15393

Log:
Patch from Yann Morin to put BLKGETSIZE64 in platform.h had rather a lot of
fallout due to the #include <sys/mount.h>.  Removed that #include from various
applets and fixed up those that were unhappy when that #include was made
because they'd block copied stuff out of it.  (Sigh.)


Modified:
   trunk/busybox/include/platform.h
   trunk/busybox/miscutils/eject.c
   trunk/busybox/miscutils/hdparm.c
   trunk/busybox/util-linux/fdisk.c
   trunk/busybox/util-linux/mount.c
   trunk/busybox/util-linux/nfsmount.c
   trunk/busybox/util-linux/swaponoff.c
   trunk/busybox/util-linux/switch_root.c
   trunk/busybox/util-linux/umount.c


Changeset:
Modified: trunk/busybox/include/platform.h
===================================================================
--- trunk/busybox/include/platform.h	2006-06-15 15:04:53 UTC (rev 15392)
+++ trunk/busybox/include/platform.h	2006-06-15 15:49:36 UTC (rev 15393)
@@ -242,8 +242,11 @@
 #define bb_setpgrp setpgrp()
 #endif
 
-#if defined(__linux__) && !defined(BLKGETSIZE64)
+#if defined(__linux__)
+#include <sys/mount.h>
+#if !defined(BLKGETSIZE64)
 #define BLKGETSIZE64 _IOR(0x12,114,size_t)
 #endif
+#endif
 
 #endif	/* platform.h	*/

Modified: trunk/busybox/miscutils/eject.c
===================================================================
--- trunk/busybox/miscutils/eject.c	2006-06-15 15:04:53 UTC (rev 15392)
+++ trunk/busybox/miscutils/eject.c	2006-06-15 15:49:36 UTC (rev 15393)
@@ -17,7 +17,6 @@
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <unistd.h>
-#include <sys/mount.h>
 #include <mntent.h>
 
 /* various defines swiped from linux/cdrom.h */

Modified: trunk/busybox/miscutils/hdparm.c
===================================================================
--- trunk/busybox/miscutils/hdparm.c	2006-06-15 15:04:53 UTC (rev 15392)
+++ trunk/busybox/miscutils/hdparm.c	2006-06-15 15:49:36 UTC (rev 15393)
@@ -14,14 +14,12 @@
 
 #include "busybox.h"
 #include <string.h>
-#include <stdlib.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <ctype.h>
 #include <sys/ioctl.h>
 #include <sys/sysmacros.h>
 #include <sys/times.h>
-#include <sys/mount.h>
 #include <sys/mman.h>
 #include <linux/types.h>
 #include <linux/hdreg.h>

Modified: trunk/busybox/util-linux/fdisk.c
===================================================================
--- trunk/busybox/util-linux/fdisk.c	2006-06-15 15:04:53 UTC (rev 15392)
+++ trunk/busybox/util-linux/fdisk.c	2006-06-15 15:49:36 UTC (rev 15393)
@@ -43,11 +43,6 @@
 
 #define DKTYPENAMES
 
-#define BLKRRPART  _IO(0x12,95)    /* re-read partition table */
-#define BLKGETSIZE _IO(0x12,96)    /* return device size */
-#define BLKFLSBUF  _IO(0x12,97)    /* flush buffer cache */
-#define BLKSSZGET  _IO(0x12,104)   /* get block device sector size */
-
 /*
    fdisk.h
 */

Modified: trunk/busybox/util-linux/mount.c
===================================================================
--- trunk/busybox/util-linux/mount.c	2006-06-15 15:04:53 UTC (rev 15392)
+++ trunk/busybox/util-linux/mount.c	2006-06-15 15:49:36 UTC (rev 15393)
@@ -13,7 +13,7 @@
  * bb_getopt_ulflags();
  */
 
-/* Design notes: There is no spec for this.  Remind me to write one.
+/* Design notes: There is no spec for mount.  Remind me to write one.
 
    mount_main() calls singlemount() which calls mount_it_now().
 
@@ -22,18 +22,14 @@
    mount_it_now() does the actual mount.
 */
 
-#include <limits.h>
-#include <stdlib.h>
+#include "busybox.h"
 #include <unistd.h>
 #include <errno.h>
 #include <string.h>
-#include <stdio.h>
 #include <mntent.h>
 #include <ctype.h>
-#include <sys/mount.h>
 #include <fcntl.h>		// for CONFIG_FEATURE_MOUNT_LOOP
 #include <sys/ioctl.h>  // for CONFIG_FEATURE_MOUNT_LOOP
-#include "busybox.h"
 
 // These two aren't always defined in old headers
 #ifndef MS_BIND

Modified: trunk/busybox/util-linux/nfsmount.c
===================================================================
--- trunk/busybox/util-linux/nfsmount.c	2006-06-15 15:04:53 UTC (rev 15392)
+++ trunk/busybox/util-linux/nfsmount.c	2006-06-15 15:49:36 UTC (rev 15393)
@@ -33,18 +33,12 @@
  * nfsmount.c,v 1.1.1.1 1993/11/18 08:40:51 jrs Exp
  */
 
+#include "busybox.h"
 #include <unistd.h>
-#include <stdio.h>
 #include <string.h>
 #include <errno.h>
-#include <netdb.h>
-#include <sys/socket.h>
 #include <time.h>
 #include <sys/utsname.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <stdlib.h>
-#include "busybox.h"
 #undef TRUE
 #undef FALSE
 #include <rpc/rpc.h>
@@ -121,19 +115,7 @@
 # define textdomain(Domain) /* empty */
 
 enum {
-	MS_MGC_VAL = 0xc0ed0000, /* Magic number indicatng "new" flags */
-	MS_RDONLY = 1,      /* Mount read-only */
-	MS_NOSUID = 2,      /* Ignore suid and sgid bits */
-	MS_NODEV = 4,      /* Disallow access to device special files */
-	MS_NOEXEC = 8,      /* Disallow program execution */
-	MS_SYNCHRONOUS = 16,      /* Writes are synced at once */
-	MS_REMOUNT = 32,      /* Alter flags of a mounted FS */
-	MS_MANDLOCK = 64,      /* Allow mandatory locks on an FS */
 	S_QUOTA = 128,     /* Quota initialized for file/directory/symlink */
-	S_APPEND = 256,     /* Append-only file */
-	S_IMMUTABLE = 512,     /* Immutable file */
-	MS_NOATIME = 1024,    /* Do not update access times. */
-	MS_NODIRATIME = 2048    /* Do not update directory access times */
 };
 
 

Modified: trunk/busybox/util-linux/swaponoff.c
===================================================================
--- trunk/busybox/util-linux/swaponoff.c	2006-06-15 15:04:53 UTC (rev 15392)
+++ trunk/busybox/util-linux/swaponoff.c	2006-06-15 15:49:36 UTC (rev 15393)
@@ -7,16 +7,13 @@
  * Licensed under the GPL v2, see the file LICENSE in this tarball.
  */
 
-#include <stdio.h>
+#include "busybox.h"
 #include <mntent.h>
 #include <dirent.h>
 #include <errno.h>
 #include <string.h>
-#include <stdlib.h>
-#include <sys/mount.h>
 #include <sys/swap.h>
 
-#include "busybox.h"
 
 static int swap_enable_disable(const char *device)
 {

Modified: trunk/busybox/util-linux/switch_root.c
===================================================================
--- trunk/busybox/util-linux/switch_root.c	2006-06-15 15:04:53 UTC (rev 15392)
+++ trunk/busybox/util-linux/switch_root.c	2006-06-15 15:49:36 UTC (rev 15393)
@@ -6,17 +6,12 @@
  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  */
 
-#include <dirent.h>
+#include "busybox.h"
 #include <fcntl.h>
-#include <stdio.h>
 #include <string.h>
-#include <sys/mount.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 #include <sys/vfs.h>
 #include <unistd.h>
 
-#include "busybox.h"
 
 // Make up for header deficiencies.
 

Modified: trunk/busybox/util-linux/umount.c
===================================================================
--- trunk/busybox/util-linux/umount.c	2006-06-15 15:04:53 UTC (rev 15392)
+++ trunk/busybox/util-linux/umount.c	2006-06-15 15:49:36 UTC (rev 15393)
@@ -11,15 +11,11 @@
  *
  */
 
-#include <limits.h>
-#include <stdio.h>
+#include "busybox.h"
 #include <mntent.h>
 #include <errno.h>
 #include <string.h>
-#include <stdlib.h>
-#include <sys/mount.h>
 #include <getopt.h>
-#include "busybox.h"
 
 #define OPTION_STRING		"flDnrvad"
 #define OPT_FORCE			1




More information about the busybox-cvs mailing list