gcc4 build fix and manpage for mdassemble
PATCH 1/1 gcc4 build fix and manpage for mdassemble
patches for 1.11.0
first one fixes compiling with gcc4 which is quite picky about signedness
second one adds a man page for mdassemble
Regards,
L.
Signature · 6 lines
Luca Berra -- [email protected] Communication Media & Services S.r.l. /"\ \ / ASCII RIBBON CAMPAIGN X AGAINST HTML MAIL / \
util.c renamed from util.c.gcc4 +7 -7
@@ -38,7 +38,7 @@* If not exactly 32 hex digits are found, return 0 * else return 1 */ -int parse_uuid (char *str,int uuid[4 ]) +int parse_uuid (char *str,__u32 uuid[4 ]) {int hit =0 ;/* number of Hex digIT */ int i;
@@ -140,7 +140,7 @@ } } -int same_uuid (int a[4 ],int b[4 ]) +int same_uuid (__u32 a[4 ],__u32 b[4 ]) { if (a[0]==b[0] && a[1]==b[1] &&
@@ -150,7 +150,7 @@return 0 ; } -void uuid_from_super (int uuid[4 ],mdp_super_t *super) +void uuid_from_super (__u32 uuid[4 ],mdp_super_t *super) { uuid[0 ] = super->set_uuid0;if (super->minor_version >=90 ) {
@@ -173,7 +173,7 @@* 2 wrong uuid * 3 wrong other info */ -int uuid1[4 ], uuid2[4 ]; +__u32 uuid1[4 ], uuid2[4 ];if (second->md_magic !=MD_SB_MAGIC )return 1 ;if (first-> md_magic !=MD_SB_MAGIC ) {
@@ -329,8 +329,8 @@return 0 ;if (read (fd, sb,1024 ) !=1024 )return 0 ; -if (strncmp (sb+52 ,"ReIsErFs" ,8 )!=0 && -strncmp (sb+52 ,"ReIsEr2Fs" ,9 )!=0 ) +if (strncmp ((char *) sb+52 ,"ReIsErFs" ,8 )!=0 && +strncmp ((char *) sb+52 ,"ReIsEr2Fs" ,9 )!=0 )return 0 ;fprintf (stderr, Name": %s appears to contain a reiserfs file system\n" ,name); size = sb[0 ]|(sb[1 ]|(sb[2 ]|sb[3 ]<<8 )<<8 )<<8 ;
@@ -512,7 +512,7 @@unsigned long long newcsum =0 ;unsigned long csum;int i; -unsigned int *superc = (int *) super; +unsigned int *superc = (unsigned int *) super; super->sb_csum =0 ;for (i=0 ; i<MD_SB_BYTES /4 ; i++)
mdadm.h renamed from mdadm.h.gcc4 +3 -3
@@ -194,7 +194,7 @@extern int md_get_version (int fd);extern int get_linux_version (void ); -extern int parse_uuid (char *str,int uuid[4 ]); +extern int parse_uuid (char *str,__u32 uuid[4 ]);extern int check_ext2 (int fd,char *name);extern int check_reiser (int fd,char *name);extern int check_raid (int fd,char *name);
@@ -212,8 +212,8 @@extern void free_line (char *line);extern int match_oneof (char *devices,char *devname);extern int load_super (int fd,mdp_super_t *super); -extern void uuid_from_super (int uuid[4 ],mdp_super_t *super); -extern int same_uuid (int a[4 ],int b[4 ]); +extern void uuid_from_super (__u32 uuid[4 ],mdp_super_t *super); +extern int same_uuid (__u32 a[4 ],__u32 b[4 ]);extern int compare_super (mdp_super_t *first,mdp_super_t *second);extern unsigned long calc_sb_csum (mdp_super_t *super);extern int store_super (int fd,mdp_super_t *super);
Assemble.c renamed from Assemble.c.gcc4 +1 -1
@@ -178,7 +178,7 @@while ( devlist) {char *devname; -int this_uuid[4 ]; +__u32 this_uuid[4 ];int dfd;struct stat stb;int havesuper=0 ;
mdassemble.8 renamed from mdassemble.8.mdassembleman +59 -0
59 lines not on this page · raw message
Makefile renamed from Makefile.mdassembleman +4 -1
@@ -67,7 +67,7 @@ ASSEMBLE_FLAGS = -DMDASSEMBLE_AUTO endif -all : mdadm mdadm.man md.man mdadm.conf.man +all : mdadm mdadm.man md.man mdadm.conf.man mdassemble.man everything: all mdadm.static mdadm.tcc mdadm.uclibc
@@ -113,6 +113,9 @@ mdadm.conf.man : mdadm.conf.5 nroff -man mdadm.conf.5 > mdadm.conf.man +mdassemble.man : mdassemble.8 + nroff -man mdassemble.8 > mdassemble.man + $(OBJS) : mdadm.h install : mdadm mdadm.8 md.4 mdadm.conf.5