From: Theodore Ts'o Date: Tue, 12 Feb 2002 07:34:44 +0000 (-0500) Subject: Lots of small random portability fixes to make e2fsprogs build X-Git-Tag: E2FSPROGS-1.27-WIP-0305~16 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7d4343d0d05ce69e0a72da5ac34eea415d4c789f;p=tools%2Fe2fsprogs.git Lots of small random portability fixes to make e2fsprogs build under AIX --- even without the 5L compatibility toolkit, and even using the uber-crippled AIX native C compiler. --- diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 2a817dd..f229390 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,17 @@ +2002-02-12 Theodore Tso + + * Makefile.in (tst_badblocks): Add some extra .o files when + linking the debugging program tst_badblocks which are + needed if we aren't compiling with inline functions enable. + + * kernel-list.h (__inline__): On non-gcc and non-Watcom compilers, + define away __inline__ since it may not be supported. + + * kernel-jbd.h (jbd_debug): For systems that don't do STDC, use a + stripped down jbd_debug that doesn't use variadic + arguments. This will cause warnings under AIX, but things + should still build. + 2002-02-03 Theodore Tso * Release of E2fsprogs 1.26 diff --git a/lib/ext2fs/Makefile.in b/lib/ext2fs/Makefile.in index dd63edc..2c2c94c 100644 --- a/lib/ext2fs/Makefile.in +++ b/lib/ext2fs/Makefile.in @@ -178,7 +178,8 @@ ext2_err.c ext2_err.h: ext2_err.et tst_badblocks: tst_badblocks.o freefs.o \ read_bb_file.o write_bb_file.o badblocks.o $(CC) -o tst_badblocks tst_badblocks.o freefs.o \ - read_bb_file.o write_bb_file.o badblocks.o $(LIBCOM_ERR) + read_bb_file.o write_bb_file.o badblocks.o \ + inline.o bitops.o gen_bitmap.o $(LIBCOM_ERR) tst_iscan: tst_iscan.o inode.o badblocks.o test_io.o $(STATIC_LIBEXT2FS) $(CC) -o tst_iscan tst_iscan.o inode.o badblocks.o test_io.o \ diff --git a/lib/ext2fs/kernel-jbd.h b/lib/ext2fs/kernel-jbd.h index 2f71d05..4280346 100644 --- a/lib/ext2fs/kernel-jbd.h +++ b/lib/ext2fs/kernel-jbd.h @@ -32,6 +32,7 @@ #define journal_oom_retry 1 +#ifdef __STDC__ #ifdef CONFIG_JBD_DEBUG /* * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal @@ -52,6 +53,9 @@ extern int journal_enable_debug; #else #define jbd_debug(f, a...) /**/ #endif +#else +#define jbd_debug(x) /* AIX doesn't do STDC */ +#endif extern void * __jbd_kmalloc (char *where, size_t size, int flags, int retry); #define jbd_kmalloc(size, flags) \ diff --git a/lib/ext2fs/kernel-list.h b/lib/ext2fs/kernel-list.h index 0e26f1f..24e6ab4 100644 --- a/lib/ext2fs/kernel-list.h +++ b/lib/ext2fs/kernel-list.h @@ -24,6 +24,10 @@ struct list_head { (ptr)->next = (ptr); (ptr)->prev = (ptr); \ } while (0) +#if (!defined(__GNUC__) && !defined(__WATCOMC__)) +#define __inline__ +#endif + /* * Insert a new entry between two known consecutive entries. * diff --git a/lib/ss/ChangeLog b/lib/ss/ChangeLog index 756bc7d..21c268e 100644 --- a/lib/ss/ChangeLog +++ b/lib/ss/ChangeLog @@ -1,3 +1,9 @@ +2002-02-12 Theodore Tso + + * requests.c (DECLARE): Fix bug in non-STDC declaration --- we + had a mismatch in the function signature and parameter + declaration sections for info/infop. + 2002-02-03 Theodore Tso * Release of E2fsprogs 1.26 diff --git a/lib/ss/requests.c b/lib/ss/requests.c index 3e6b5d8..56e429b 100644 --- a/lib/ss/requests.c +++ b/lib/ss/requests.c @@ -20,8 +20,8 @@ #define DECLARE(name) void name(int argc,const char * const *argv, \ int sci_idx, void *infop) #else -#define DECLARE(name) void name(argc,argv,sci_idx,info)int argc,sci_idx;char **argv;void *infop; - +#define DECLARE(name) void name(argc,argv,sci_idx,infop) \ + int argc,sci_idx;char **argv;void *infop; #endif /* diff --git a/misc/ChangeLog b/misc/ChangeLog index 1ef6f3b..2774a5d 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,12 @@ +2002-02-12 Theodore Tso + + * get_device_by_label.c: Since on non-STDC compilers, we define + away const, include get_device_by_label.h after we include + fsck.h. + + * Makefile.in (base_device): Remove use of $<, which is + non-portable. + 2002-02-03 Theodore Tso * Release of E2fsprogs 1.26 diff --git a/misc/Makefile.in b/misc/Makefile.in index e922ffa..6a16a11 100644 --- a/misc/Makefile.in +++ b/misc/Makefile.in @@ -62,7 +62,8 @@ e2image: $(E2IMAGE_OBJS) $(DEPLIBS) $(CC) $(ALL_LDFLAGS) -o e2image $(E2IMAGE_OBJS) $(LIBS) base_device: base_device.c - $(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $< -DDEBUG -o $@ + $(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(srcdir)/base_device.c \ + -DDEBUG -o base_device fstype: fstype.c $(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -DTEST_PROGRAM $(srcdir)/fstype.c \ diff --git a/misc/get_device_by_label.c b/misc/get_device_by_label.c index 9223fcf..3f68dd8 100644 --- a/misc/get_device_by_label.c +++ b/misc/get_device_by_label.c @@ -30,8 +30,8 @@ #endif #include #include "nls-enable.h" -#include "get_device_by_label.h" #include "fsck.h" +#include "get_device_by_label.h" /* function prototype from libext2 */ extern char *ext2fs_find_block_device(dev_t device); diff --git a/tests/ChangeLog b/tests/ChangeLog index 1ef6f02..12dda49 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,14 @@ +2002-02-12 Theodore Tso + + * run_e2fsck (status): Use separate sed invocations for greater + portabilty. AIX's sed doesn't support multiple -e + specifications, even though it's required by Unix 98. + + * test_script.in: Use printf instead of "echo -n", since the -n + option to echo is a BSD'ism which isn't specified by the + Unix 98 / SUSv3 specification. (And which of course, AIX + doesn't implement as a result.) + 2002-02-03 Theodore Tso * Release of E2fsprogs 1.26 diff --git a/tests/run_e2fsck b/tests/run_e2fsck index 6f8f691..44cc285 100644 --- a/tests/run_e2fsck +++ b/tests/run_e2fsck @@ -33,14 +33,14 @@ eval $PREP_CMD $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT1.new 2>&1 status=$? echo Exit status is $status >> $OUT1.new -sed -e '1d' -e '/^JFS DEBUG:/d' $OUT1.new | tr -d '\r' > $OUT1 +sed -e '1d' $OUT1.new | sed -e '/^JFS DEBUG:/d' | tr -d '\r' > $OUT1 rm -f $OUT1.new if [ "$ONE_PASS_ONLY" != "true" ]; then $FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1 status=$? echo Exit status is $status >> $OUT2.new - sed -e '1d' $OUT2.new -e '/^JFS DEBUG:/d' > $OUT2 + sed -e '1d' $OUT2.new | sed -e '/^JFS DEBUG:/d' > $OUT2 rm -f $OUT2.new fi diff --git a/tests/test_script.in b/tests/test_script.in index f53ea46..8778882 100644 --- a/tests/test_script.in +++ b/tests/test_script.in @@ -37,9 +37,9 @@ do fi if [ -f $test_dir/name ]; then test_description=`cat $test_dir/name` - echo -n "$test_name: $test_description: " + printf "%s: %s: " "$test_name" "$test_description" else - echo -n "$test_name: " + printf "%s: " "$test_name" fi if [ -f $test_dir/script ]; then . $test_dir/script