Remove duplicate definitions in xfsprogs
PATCH 1/1 Remove duplicate definitions in xfsprogs
This is userspace. I have no idea what I'm doing.
Building on current Debian testing gives:
/usr/bin/ld: ../libxlog/.libs/libxlog.a(util.o):xfsprogs/libxlog/util.c:25: multiple definition of `x'; init.o:xfsprogs/db/init.c:42: first defined here
and
/usr/bin/ld: ../libxfs/.libs/libxfs.a(init.o):xfsprogs/libxfs/init.c:39: multiple definition of `progname'; xfs_mdrestore.o:xfsprogs/mdrestore/xfs_mdrestore.c:22: first defined here
It seems to me that xfsprogs was relying on the linker to merge duplicate definitions, and now the linker is declining to do so?
Feel free to split this up into individual patches, or whatever seems best ...
db/init.c +0 -1
@@ -39,7 +39,6 @@ int force;struct xfs_mount xmount;struct xfs_mount *mp;struct xlog xlog; -libxfs_init_t x;xfs_agnumber_t cur_agno =NULLAGNUMBER ; static void
logprint/logprint.c +1 -1
@@ -36,7 +36,6 @@ int print_buffer;int print_overwrite;int print_no_data;int print_no_print; -int print_exit =1 ;/* -e is now default. specify -c to override */ int print_operation =OP_PRINT ;void
@@ -146,6 +145,7 @@ main(int argc, char **argv)memset (&mount,0 ,sizeof (mount)); progname =basename (argv[0 ]); + print_exit =1 ;/* -e is now default. specify -c to override */ while ((c =getopt (argc, argv,"bC:cdefl:iqnors:tDVv" )) !=EOF ) {switch (c) {case 'D' :
mdrestore/xfs_mdrestore.c +0 -1
@@ -19,7 +19,6 @@#include "libxfs.h" #include "xfs_metadump.h" -char *progname;int show_progress =0 ;int show_info =0 ;int progress_since_warning =0 ;
Quoted 1 line · Matthew Wilcox
This is userspace. I have no idea what I'm doing.
Heh.
db/init.c int force; · line 42
Quoted 9 lines
db/init.c +0
-1@@ -39,7 +39,6 @@ int force;struct xfs_mount xmount;struct xfs_mount *mp;struct xlog xlog; -libxfs_init_t x;
I did rework the libxfs_init structure (and remove this typedef) in xfsprogs for-next, which I think should have also fixed the duplicated declaration for "x".
The other fixups look ok to me. The global variables in libraries aren't exactly a nice pattern, but I think we'll have to live with them for now.