[patch] fix cpp warnings from recent commits

Erik Hovland erik at hovland.org
Thu Jun 15 22:49:06 UTC 2006


Recent commits of freeramdisk.c, fsck_minix.c, mkfs_minix.c and mkswap.c
introduced some cpp warnings associated to macros which are typically
provided on linux systems with semi-modern kernels and libcs.

This patch wraps the #define in question with corresponding #ifndef.

Thanks

E

-- 
Erik Hovland
mail: erik AT hovland DOT org
web: http://hovland.org/
PGP/GPG public key available on request
-------------- next part --------------
Index: util-linux/freeramdisk.c
===================================================================
--- util-linux/freeramdisk.c	(revision 15397)
+++ util-linux/freeramdisk.c	(working copy)
@@ -16,10 +16,13 @@
 #include <sys/ioctl.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <sys/mount.h> /* This containts BLKFLSBUF on most linux systems */
 #include "busybox.h"
 
 /* From linux/fs.h */
+#ifndef BLKFLSBUF
 #define BLKFLSBUF  _IO(0x12,97)
+#endif
 /* From <linux/fd.h> */
 #define FDFLUSH  _IO(2,0x4b)
 
Index: util-linux/fsck_minix.c
===================================================================
--- util-linux/fsck_minix.c	(revision 15397)
+++ util-linux/fsck_minix.c	(working copy)
@@ -99,7 +99,9 @@
 #include "busybox.h"
 
 #define BLOCK_SIZE_BITS 10
+#ifndef BLOCK_SIZE
 #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
+#endif
 
 /*
  * This is the original minix inode layout on disk.
Index: util-linux/mkswap.c
===================================================================
--- util-linux/mkswap.c	(revision 15397)
+++ util-linux/mkswap.c	(working copy)
@@ -50,9 +50,11 @@
 /* pre-1.3.45 */
 enum { BLKGETSIZE = 0x1260 };
 #else
+#ifndef BLKGETSIZE
 /* same on i386, m68k, arm; different on alpha, mips, sparc, ppc */
 #define BLKGETSIZE _IO(0x12,96)
 #endif
+#endif
 
 static char *device_name = NULL;
 static int DEV = -1;
Index: util-linux/mkfs_minix.c
===================================================================
--- util-linux/mkfs_minix.c	(revision 15397)
+++ util-linux/mkfs_minix.c	(working copy)
@@ -152,7 +152,9 @@
 };
 
 #define BLOCK_SIZE_BITS 10
+#ifndef BLOCK_SIZE
 #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
+#endif
 
 #define NAME_MAX         255   /* # chars in a file name */
 


More information about the busybox mailing list