Whamcloud - gitweb
Lots of small random portability fixes to make e2fsprogs build
authorTheodore Ts'o <tytso@mit.edu>
Tue, 12 Feb 2002 07:34:44 +0000 (02:34 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 12 Feb 2002 07:34:44 +0000 (02:34 -0500)
under AIX --- even without the 5L compatibility toolkit, and even
using the uber-crippled AIX native C compiler.

12 files changed:
lib/ext2fs/ChangeLog
lib/ext2fs/Makefile.in
lib/ext2fs/kernel-jbd.h
lib/ext2fs/kernel-list.h
lib/ss/ChangeLog
lib/ss/requests.c
misc/ChangeLog
misc/Makefile.in
misc/get_device_by_label.c
tests/ChangeLog
tests/run_e2fsck
tests/test_script.in

index 2a817dd..f229390 100644 (file)
@@ -1,3 +1,17 @@
+2002-02-12  Theodore Tso  <tytso@valinux.com>
+
+       * 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  <tytso@thunk.org>
 
        * Release of E2fsprogs 1.26
index dd63edc..2c2c94c 100644 (file)
@@ -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 \
index 2f71d05..4280346 100644 (file)
@@ -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) \
index 0e26f1f..24e6ab4 100644 (file)
@@ -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. 
  *
index 756bc7d..21c268e 100644 (file)
@@ -1,3 +1,9 @@
+2002-02-12  Theodore Tso  <tytso@valinux.com>
+
+       * 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  <tytso@thunk.org>
 
        * Release of E2fsprogs 1.26
index 3e6b5d8..56e429b 100644 (file)
@@ -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
        
 /*
index 1ef6f3b..2774a5d 100644 (file)
@@ -1,3 +1,12 @@
+2002-02-12  Theodore Tso  <tytso@valinux.com>
+
+       * 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  <tytso@thunk.org>
 
        * Release of E2fsprogs 1.26
index e922ffa..6a16a11 100644 (file)
@@ -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 \
index 9223fcf..3f68dd8 100644 (file)
@@ -30,8 +30,8 @@
 #endif
 #include <dirent.h>
 #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);
index 1ef6f02..12dda49 100644 (file)
@@ -1,3 +1,14 @@
+2002-02-12  Theodore Tso  <tytso@valinux.com>
+
+       * 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  <tytso@thunk.org>
 
        * Release of E2fsprogs 1.26
index 6f8f691..44cc285 100644 (file)
@@ -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
 
index f53ea46..8778882 100644 (file)
@@ -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