[DRBD-cvs] r1627 - trunk/drbd

svn at svn.drbd.org svn at svn.drbd.org
Wed Nov 3 23:49:47 CET 2004


Author: lars
Date: 2004-11-03 23:49:44 +0100 (Wed, 03 Nov 2004)
New Revision: 1627

Modified:
   trunk/drbd/drbd_sizeof_sanity_check.c
Log:
this is how I did sizeof sanity check in 0.7 branch meanwhile

Modified: trunk/drbd/drbd_sizeof_sanity_check.c
===================================================================
--- trunk/drbd/drbd_sizeof_sanity_check.c	2004-11-03 22:16:15 UTC (rev 1626)
+++ trunk/drbd/drbd_sizeof_sanity_check.c	2004-11-03 22:49:44 UTC (rev 1627)
@@ -6,14 +6,16 @@
 	__attribute__ ((format (printf, 1, 2)));
 
 #define SZO(type,size) \
-	if (sizeof(type) != size) { \
-		printk("<3>sizeof(" #type ") != %d; " \
-			"ioctls won't work, aborting\n", size); \
-		return -1; \
+	s = sizeof(type); \
+	if (s != size) { \
+		printk("<3>sizeof(" #type "): %d != %d; " \
+			"ioctls won't work, aborting\n", s, size); \
+		err = -1; \
 	}
 
 int sizeof_drbd_structs_sanity_check(void)
 {
+	int err = 0, s = 0;
 	SZO(struct disk_config,		 24)
 	SZO(struct net_config,		304)
 	SZO(struct syncer_config,	 24)
@@ -22,5 +24,5 @@
 	SZO(struct ioctl_syncer_config,	 32)
 	SZO(struct ioctl_wait,		 16)
 	SZO(struct ioctl_get_config,	432)
-	return 0;
+	return err;
 }



More information about the drbd-cvs mailing list