add CFLAGS to mdassemble build and fix a couple of non-returning functions
pass CFLAGS to mdassemble build, enabling -Wall -Werror showed some issues also fixed by the patch. From: Luca Berra <bluca@vodka.it> Signed-off-by: Neil Brown <neilb@suse.de>
This commit is contained in:
parent
b1ec2d6a74
commit
b56c363090
4
Makefile
4
Makefile
|
@ -73,7 +73,7 @@ SRCS = mdadm.c config.c mdstat.c ReadMe.c util.c Manage.c Assemble.c Build.c \
|
|||
mdopen.c super0.c super1.c bitmap.c restripe.c sysfs.c
|
||||
|
||||
ASSEMBLE_SRCS := mdassemble.c Assemble.c config.c dlink.c util.c super0.c super1.c
|
||||
ASSEMBLE_FLAGS:= -DMDASSEMBLE
|
||||
ASSEMBLE_FLAGS:= $(CFLAGS) -DMDASSEMBLE
|
||||
ifdef MDASSEMBLE_AUTO
|
||||
ASSEMBLE_SRCS += mdopen.c mdstat.c
|
||||
ASSEMBLE_FLAGS += -DMDASSEMBLE_AUTO
|
||||
|
@ -121,7 +121,7 @@ mdassemble.uclibc : $(ASSEMBLE_SRCS) mdadm.h
|
|||
# This doesn't work
|
||||
mdassemble.klibc : $(ASSEMBLE_SRCS) mdadm.h
|
||||
rm -f $(OBJS)
|
||||
$(KLIBC_GCC) $(CFLAGS) $(ASSEMBLE_FLAGS) -o mdassemble $(ASSEMBLE_SRCS)
|
||||
$(KLIBC_GCC) $(ASSEMBLE_FLAGS) -o mdassemble $(ASSEMBLE_SRCS)
|
||||
|
||||
mdadm.man : mdadm.8
|
||||
nroff -man mdadm.8 > mdadm.man
|
||||
|
|
6
mdadm.h
6
mdadm.h
|
@ -44,10 +44,8 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
|
|||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <syslog.h>
|
||||
#ifdef __dietlibc__NONO
|
||||
int strncmp(const char *s1, const char *s2, size_t n) __THROW __pure__;
|
||||
char *strncpy(char *dest, const char *src, size_t n) __THROW;
|
||||
#include <strings.h>
|
||||
#ifdef __dietlibc__
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ mapping_t pers[] = {
|
|||
};
|
||||
|
||||
#ifndef MDASSEMBLE_AUTO
|
||||
/* from mdadm.c */
|
||||
/* from mdopen.c */
|
||||
int open_mddev(char *dev, int autof/*unused */)
|
||||
{
|
||||
int mdfd = open(dev, O_RDWR, 0);
|
||||
|
@ -79,7 +79,7 @@ int readonly = 0;
|
|||
int verbose = 0;
|
||||
int force = 0;
|
||||
|
||||
int main() {
|
||||
int main(int argc, char *argv[]) {
|
||||
mddev_ident_t array_list = conf_get_ident(configfile, NULL);
|
||||
if (!array_list) {
|
||||
fprintf(stderr, Name ": No arrays found in config file\n");
|
||||
|
@ -100,4 +100,5 @@ int main() {
|
|||
NULL, NULL,
|
||||
readonly, runstop, NULL, NULL, verbose, force);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
|
2
util.c
2
util.c
|
@ -375,7 +375,7 @@ int add_dev_1(const char *name, const struct stat *stb, int flag)
|
|||
}
|
||||
int nftw(const char *path, int (*han)(const char *name, const struct stat *stb, int flag, struct FTW *s), int nopenfd, int flags)
|
||||
{
|
||||
ftw(path, add_dev_1, nopenfd);
|
||||
return ftw(path, add_dev_1, nopenfd);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue