]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Fix up lots of portability problems that caused e2fsprogs not to build successfully
authorTheodore Ts'o <tytso@mit.edu>
Thu, 6 Mar 2003 16:09:18 +0000 (11:09 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 6 Mar 2003 16:09:18 +0000 (11:09 -0500)
under Solaris.

31 files changed:
ChangeLog
Makefile.in
debugfs/ChangeLog
debugfs/debugfs.c
debugfs/dump.c
debugfs/htree.c
debugfs/logdump.c
debugfs/ls.c
doc/ChangeLog
doc/Makefile.in
lib/blkid/ChangeLog
lib/blkid/Makefile.in
lib/blkid/blkid_types.h.in
lib/blkid/devname.c
lib/blkid/list.h
lib/blkid/probe.h
lib/ext2fs/ChangeLog
lib/ext2fs/ext2_ext_attr.h
lib/ext2fs/ext2_types.h.in
lib/ext2fs/flushb.c
lib/ext2fs/ismounted.c
lib/ext2fs/kernel-jbd.h
lib/uuid/ChangeLog
lib/uuid/Makefile.in
lib/uuid/uuid_types.h.in
misc/ChangeLog
misc/Makefile.in
tests/ChangeLog
tests/defaults/e_script
tests/f_swapfs/script
tests/run_e2fsck

index f7abf75b5f0ad7e51a98f7bd7178763b21ad5cba..013f10aaba2415c46bd2a8bdbd648239a29c66ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-03-06  Theodore Tso  <tytso@thunk.org>
+
+       * Makefile.in (.exclude-subset): Include the doc directory in the
+               subset distribution.
+
 2003-03-02  Theodore Ts'o  <tytso@mit.edu>
 
        * configure.in, Makefile.in: Ignore missing directories so we can
index edf08053ea34b45f57132299457c1e7b876d0c42..34128e8c125079a5f999529a22a7723cc930a0b7 100644 (file)
@@ -179,7 +179,6 @@ $(srcdir)/.exclude-subset:
        echo "$(SSROOT)/misc" >> $(srcdir)/.exclude-subset
        echo "$(SSROOT)/tests" >> $(srcdir)/.exclude-subset
        echo "$(SSROOT)/resize" >> $(srcdir)/.exclude-subset
-       echo "$(SSROOT)/doc" >> $(srcdir)/.exclude-subset
        echo "$(SSROOT)/contrib" >> $(srcdir)/.exclude-subset
        echo "$(SSROOT)/po" >> $(srcdir)/.exclude-subset
        echo "$(SSROOT)/include" >> $(srcdir)/.exclude-subset
index 184ab2aacfdb9fedea5ef0f5408054c85a175c21..88583a613fcc74e407b083178f0888ef0c15852f 100644 (file)
@@ -1,3 +1,10 @@
+2003-03-06  Theodore Tso  <tytso@mit.edu>
+
+       * debugfs.c (do_open_filesys, do_show_super_stats), 
+       ls.c (do_list_dir), dump.c (do_dump), htree.c (do_htree_dump, 
+       do_dx_hash), logdump.c (do_logdump): Reset optind to 1 for better
+       compatibility with non-glibc implementations of getopt.
+
 2003-03-01  Theodore Ts'o  <tytso@mit.edu>
 
        * Makefile.in, logdump.c (do_logdump): Use the blkid functions to
index 2294104607bf299dc7aab2148f4edd686188304f..a9a6c63ddb855762f118f6c8237c0912b53d03e5 100644 (file)
@@ -101,7 +101,7 @@ void do_open_filesys(int argc, char **argv)
        blk_t   blocksize = 0;
        int open_flags = 0;
        
-       optind = 0;
+       optind = 1;
 #ifdef HAVE_OPTRESET
        optreset = 1;           /* Makes BSD getopt happy */
 #endif
@@ -242,7 +242,7 @@ void do_show_super_stats(int argc, char *argv[])
        int     numdirs = 0;
        const char *usage = "Usage: show_super [-h]";
 
-       optind = 0;
+       optind = 1;
 #ifdef HAVE_OPTRESET
        optreset = 1;           /* Makes BSD getopt happy */
 #endif
index e9227f0f7783656b29b4f974c647a7769acd5572..303f7e1831108245158e2b01e5af3d2a906c1c23 100644 (file)
@@ -149,7 +149,7 @@ void do_dump(int argc, char **argv)
        const char *dump_usage = "Usage: dump_inode [-p] <file> <output_file>";
        char            *in_fn, *out_fn;
        
-       optind = 0;
+       optind = 1;
 #ifdef HAVE_OPTRESET
        optreset = 1;           /* Makes BSD getopt happy */
 #endif
index 13c0916d734814fe24eb4c27a0a57787c902c48a..b9403d97ca10fe9ffdf2c30b81946ee8b23ba8df 100644 (file)
@@ -193,7 +193,7 @@ void do_htree_dump(int argc, char *argv[])
 
        pager = open_pager();
 
-       optind = 0;
+       optind = 1;
 #ifdef HAVE_OPTRESET
        optreset = 1;           /* Makes BSD getopt happy */
 #endif
@@ -277,7 +277,7 @@ void do_dx_hash(int argc, char *argv[])
        __u32           hash_seed[4];
        
        hash_seed[0] = hash_seed[1] = hash_seed[2] = hash_seed[3] = 0;
-       optind = 0;
+       optind = 1;
 #ifdef HAVE_OPTRESET
        optreset = 1;           /* Makes BSD getopt happy */
 #endif
index df11c16269901b3d9f9894954be0d9459a9c4ead..1e195ba978d352cc7e387bfbd87dae043521d29c 100644 (file)
@@ -92,7 +92,7 @@ void do_logdump(int argc, char **argv)
        struct journal_source journal_source;
        struct ext2_super_block *es = NULL;
        
-       optind = 0;
+       optind = 1;
 #ifdef HAVE_OPTRESET
        optreset = 1;           /* Makes BSD getopt happy */
 #endif
index 3064598dc20d014311c25bd5a64c455ab6d317f9..a66482dc7e884f71f89d9f8cc55dd5456fd905fa 100644 (file)
@@ -125,7 +125,7 @@ void do_list_dir(int argc, char *argv[])
        if (check_fs_open(argv[0]))
                return;
 
-       optind = 0;
+       optind = 1;
 #ifdef HAVE_OPTRESET
        optreset = 1;           /* Makes BSD getopt happy */
 #endif
index 87fb84595b8dfe03f8d8df74e5c0e35d1d07a805..430b5cda9f77e7ce848d464885d1e6e0e880fdd2 100644 (file)
@@ -1,3 +1,8 @@
+2003-03-06  Theodore Tso  <tytso@mit.edu>
+
+       * Makefile.in: Don't bomb out if makeinfo or texinfo aren't
+               present.  They aren't on all systems.
+
 2003-03-01  Theodore Ts'o  <tytso@mit.edu>
 
        * libblkid.txt (token): New file which gives basic
index e402d9e79b528dc10f5b0fdbeaf22a86501ca6be..f3f11f2e5d2539b535dcdc081e104486675127cc 100644 (file)
@@ -30,10 +30,10 @@ uninstall-doc-libs:
        $(RM) -rf $(DESTDIR)$(infodir)/libext2fs.info*
 
 libext2fs.info: $(srcdir)/libext2fs.texinfo
-       $(INFO) $(srcdir)/libext2fs.texinfo
+       -$(INFO) $(srcdir)/libext2fs.texinfo
 
 libext2fs.dvi: $(srcdir)/libext2fs.texinfo
-       $(DVI) $(srcdir)/libext2fs.texinfo
+       -$(DVI) $(srcdir)/libext2fs.texinfo
 
 .PHONY: distclean
 distclean:: clean
index 88963e30901b5e7eefd88799ebbe1c1fda5c28f2..a5b06a6c5ed1f007ab8edbd8497a1af48858d926 100644 (file)
@@ -1,3 +1,18 @@
+2003-03-06  Theodore Tso  <tytso@mit.edu>
+
+       * blkid_types.h.in: Don't redefine types if other e2fsprogs
+               *_types.h files have been included already.
+
+       * list.h, probe.h: Use static inline instead of extern inline to
+               comply with C99 inline support.
+
+       * devname.c (blkid_probe_all): Avoid GCC extension; don't
+               initialize an array with the address of an automatic
+               variable.
+
+       * Makefile.in: Eliminate -Wall as a C compiler option by default;
+               it's not portable.
+
 2003-03-02  Theodore Ts'o  <tytso@mit.edu>
 
        * Makefile.in: Don't install list.h, since it's not used by the
index 58bc8331d55a1d16699cc1af977806e4397ad7cb..05574e7025d0c37ec0a87ddd247a40aa0c072d85 100644 (file)
@@ -54,7 +54,7 @@ LIBS_BLKID=   $(STATIC_LIBBLKID) $(STATIC_LIBUUID)
 DEPLIBS_BLKID= $(DEPSTATIC_LIBBLKID) $(DEPSTATIC_LIBUUID)
 
 .c.o:
-       $(CC) -Wall $(ALL_CFLAGS) -c $< -o $@
+       $(CC) $(ALL_CFLAGS) -c $< -o $@
 @PROFILE_CMT@  $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
 @CHECKER_CMT@  $(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $<
 @DLL_CMT@      (export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) $(ALL_CFLAGS) \
@@ -71,38 +71,38 @@ libblkid.3: $(DEP_SUBSTITUTE) $(srcdir)/libblkid.3.in
        $(SUBSTITUTE) $(srcdir)/libblkid.3.in libblkid.3
 
 tst_cache: $(srcdir)/cache.c $(DEPLIBS_BLKID)
-       $(CC) -Wall -o tst_cache -DTEST_PROGRAM $(srcdir)/cache.c $(LIBS_BLKID) $(LIBUUID) $(ALL_CFLAGS)
+       $(CC) -o tst_cache -DTEST_PROGRAM $(srcdir)/cache.c $(LIBS_BLKID) $(ALL_CFLAGS)
 
 tst_dev: $(srcdir)/dev.c $(DEPLIBS_BLKID)
-       $(CC) -Wall -o tst_dev -DTEST_PROGRAM $(srcdir)/dev.c $(LIBS_BLKID) $(ALL_CFLAGS)
+       $(CC) -o tst_dev -DTEST_PROGRAM $(srcdir)/dev.c $(LIBS_BLKID) $(ALL_CFLAGS)
 
 tst_devname: $(srcdir)/devname.c $(DEPLIBS_BLKID)
-       $(CC) -Wall -o tst_devname -DTEST_PROGRAM $(srcdir)/devname.c $(LIBS_BLKID) $(ALL_CFLAGS)
+       $(CC) -o tst_devname -DTEST_PROGRAM $(srcdir)/devname.c $(LIBS_BLKID) $(ALL_CFLAGS)
 
 tst_devno: $(srcdir)/devno.c $(DEPLIBS_BLKID)
-       $(CC) -Wall -o tst_devno -DTEST_PROGRAM $(srcdir)/devno.c $(LIBS_BLKID) $(ALL_CFLAGS)
+       $(CC) -o tst_devno -DTEST_PROGRAM $(srcdir)/devno.c $(LIBS_BLKID) $(ALL_CFLAGS)
 
 tst_getsize: $(srcdir)/getsize.c $(DEPLIBS_BLKID)
-       $(CC) -Wall -o tst_getsize -DTEST_PROGRAM $(srcdir)/getsize.c $(LIBS_BLKID) $(ALL_CFLAGS)
+       $(CC) -o tst_getsize -DTEST_PROGRAM $(srcdir)/getsize.c $(LIBS_BLKID) $(ALL_CFLAGS)
 
 tst_probe: $(srcdir)/probe.c $(DEPLIBS_BLKID)
-       $(CC) -Wall -o tst_probe -DTEST_PROGRAM $(srcdir)/probe.c $(LIBS_BLKID) $(LIBUUID) $(ALL_CFLAGS)
+       $(CC) -o tst_probe -DTEST_PROGRAM $(srcdir)/probe.c $(LIBS_BLKID) $(ALL_CFLAGS)
 
 tst_read: $(srcdir)/read.c $(DEPLIBS_BLKID)
-       $(CC) -Wall -o tst_read -DTEST_PROGRAM $(srcdir)/read.c $(LIBS_BLKID) $(ALL_CFLAGS)
+       $(CC) -o tst_read -DTEST_PROGRAM $(srcdir)/read.c $(LIBS_BLKID) $(ALL_CFLAGS)
 
 tst_resolve: $(srcdir)/resolve.c $(DEPLIBS_BLKID)
-       $(CC) -Wall -o tst_resolve -DTEST_PROGRAM $(srcdir)/resolve.c $(LIBS_BLKID) $(LIBUUID) $(ALL_CFLAGS)
+       $(CC) -o tst_resolve -DTEST_PROGRAM $(srcdir)/resolve.c $(LIBS_BLKID) $(ALL_CFLAGS)
 
 tst_save: $(srcdir)/save.c $(DEPLIBS_BLKID)
-       $(CC) -Wall -o tst_save -DTEST_PROGRAM $(srcdir)/save.c $(LIBS_BLKID) $(LIBUUID) $(ALL_CFLAGS)
+       $(CC) -o tst_save -DTEST_PROGRAM $(srcdir)/save.c $(LIBS_BLKID) $(ALL_CFLAGS)
 
 ../../misc/blkid.o: $(top_srcdir)/misc/blkid.c blkid.h
-       $(CC) -Wall $(ALL_CFLAGS) -c $(top_srcdir)/misc/blkid.c \
+       $(CC) $(ALL_CFLAGS) -c $(top_srcdir)/misc/blkid.c \
                -o ../../misc/blkid.o
 
-blkid: ../../misc/blkid.o libblkid.a $(LIBUUID)
-       $(CC) -Wall -o blkid ../../misc/blkid.o libblkid.a $(LIBUUID)
+blkid: ../../misc/blkid.o libblkid.a $(DEPLIBUUID)
+       $(CC) -o blkid ../../misc/blkid.o libblkid.a $(LIBUUID)
 
 check:: all tst_cache tst_devname tst_devno tst_getsize tst_probe \
  tst_read tst_resolve tst_save
index 1fb4d27a248ee82157ed9944f83bbfaa8a5dcb0f..9de6804e03e818a860924df3d8a4aef6b2fbb47f 100644 (file)
@@ -1,11 +1,11 @@
-#ifndef _BLKID_TYPES_H
-#define _BLKID_TYPES_H
-
 /* 
  * If linux/types.h is already been included, assume it has defined
- * everything we need.  (cross fingers)
+ * everything we need.  (cross fingers)  Other header files may have 
+ * also defined the types that we need.
  */
-#ifndef _LINUX_TYPES_H
+#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \
+       !defined(_UUID_TYPES) && !defined(_EXT2_TYPES_H))
+#define _BLKID_TYPES_H
 
 typedef unsigned char __u8;
 typedef signed char __s8;
@@ -48,6 +48,4 @@ typedef       unsigned short  __u32;
  ?== error: undefined 32 bit type
 #endif
 
-#endif /* LINUX_TYPES_H */
-
-#endif /* BLKID_TYPES_H */
+#endif /* _*_TYPES_H */
index 27a9d0c0fab6bd0178f012a7ef6137a96bd7ac5b..df7700185e1c47e42100bee2ff27428ffeb4b4be 100644 (file)
@@ -266,13 +266,16 @@ int blkid_probe_all(blkid_cache cache)
        FILE *proc;
        char line[1024];
        char ptname0[128], ptname1[128], *ptname = 0;
-       char *ptnames[2] = { ptname0, ptname1 };
+       char *ptnames[2];
        dev_t devs[2];
        int ma, mi;
        unsigned long long sz;
        int lens[2] = { 0, 0 };
        int which = 0, last = 0;
 
+       ptnames[0] = ptname0;
+       ptnames[1] = ptname1;
+
        if (!cache)
                return -BLKID_ERR_PARAM;
 
index 7800a4642a9536aa73922aec9b79b97f20b80213..c1cbfec59cbf9ee5923ab81675286f11e6f1f0a5 100644 (file)
@@ -5,6 +5,12 @@
 extern "C" {
 #endif
 
+#ifdef __GNUC__
+#define _INLINE_ static __inline__
+#else                         /* For Watcom C */
+#define _INLINE_ static inline
+#endif
+
 /*
  * Simple doubly linked list implementation.
  *
@@ -34,7 +40,7 @@ struct list_head {
  * This is only for internal list manipulation where we know
  * the prev/next entries already!
  */
-static __inline__ void __list_add(struct list_head * add,
+_INLINE_ void __list_add(struct list_head * add,
        struct list_head * prev,
        struct list_head * next)
 {
@@ -52,7 +58,7 @@ static __inline__ void __list_add(struct list_head * add,
  * Insert a new entry after the specified head.
  * This is good for implementing stacks.
  */
-static __inline__ void list_add(struct list_head *add, struct list_head *head)
+_INLINE_ void list_add(struct list_head *add, struct list_head *head)
 {
        __list_add(add, head, head->next);
 }
@@ -65,7 +71,7 @@ static __inline__ void list_add(struct list_head *add, struct list_head *head)
  * Insert a new entry before the specified head.
  * This is useful for implementing queues.
  */
-static __inline__ void list_add_tail(struct list_head *add, struct list_head *head)
+_INLINE_ void list_add_tail(struct list_head *add, struct list_head *head)
 {
        __list_add(add, head->prev, head);
 }
@@ -77,7 +83,7 @@ static __inline__ void list_add_tail(struct list_head *add, struct list_head *he
  * This is only for internal list manipulation where we know
  * the prev/next entries already!
  */
-static __inline__ void __list_del(struct list_head * prev,
+_INLINE_ void __list_del(struct list_head * prev,
                                  struct list_head * next)
 {
        next->prev = prev;
@@ -91,7 +97,7 @@ static __inline__ void __list_del(struct list_head * prev,
  * list_empty() on @entry does not return true after this, @entry is
  * in an undefined state.
  */
-static __inline__ void list_del(struct list_head *entry)
+_INLINE_ void list_del(struct list_head *entry)
 {
        __list_del(entry->prev, entry->next);
 }
@@ -100,7 +106,7 @@ static __inline__ void list_del(struct list_head *entry)
  * list_del_init - deletes entry from list and reinitialize it.
  * @entry:     the element to delete from the list.
  */
-static __inline__ void list_del_init(struct list_head *entry)
+_INLINE_ void list_del_init(struct list_head *entry)
 {
        __list_del(entry->prev, entry->next);
        INIT_LIST_HEAD(entry);
@@ -110,7 +116,7 @@ static __inline__ void list_del_init(struct list_head *entry)
  * list_empty - tests whether a list is empty
  * @head:      the list to test.
  */
-static __inline__ int list_empty(struct list_head *head)
+_INLINE_ int list_empty(struct list_head *head)
 {
        return head->next == head;
 }
@@ -120,7 +126,7 @@ static __inline__ int list_empty(struct list_head *head)
  * @list:      the new list to add.
  * @head:      the place to add it in the first list.
  */
-static __inline__ void list_splice(struct list_head *list, struct list_head *head)
+_INLINE_ void list_splice(struct list_head *list, struct list_head *head)
 {
        struct list_head *first = list->next;
 
@@ -164,6 +170,8 @@ static __inline__ void list_splice(struct list_head *list, struct list_head *hea
        for (pos = (head)->next, pnext = pos->next; pos != (head); \
             pos = pnext, pnext = pos->next)
 
+#undef _INLINE_
+
 #ifdef __cplusplus
 }
 #endif
index 391428cab9ced3c1e0fdbeb54571ba939597c973..8302b3f45ba81578ae8f3c7aa404c28646bf589f 100644 (file)
@@ -194,14 +194,14 @@ struct hfs_super_block {
  * Byte swap functions
  */
 #ifdef __GNUC__
-#define _INLINE_ extern __inline__
+#define _INLINE_ static __inline__
 #else                          /* For Watcom C */
-#define _INLINE_ extern inline
+#define _INLINE_ static inline
 #endif
 
-extern __u16 blkid_swab16(__u16 val);
-extern __u32 blkid_swab32(__u32 val);
-extern __u64 blkid_swab64(__u64 val);
+static __u16 blkid_swab16(__u16 val);
+static __u32 blkid_swab32(__u32 val);
+static __u64 blkid_swab64(__u64 val);
 
 #if ((defined __GNUC__) && \
      (defined(__i386__) || defined(__i486__) || defined(__i586__)))
@@ -250,7 +250,7 @@ _INLINE_ __u32 blkid_swab32(__u32 val)
                ((val<<8)&0xFF0000) | (val<<24));
 }
 
-_INLINE_ u64 blkid_swab64(__u64 val)
+_INLINE_ __u64 blkid_swab64(__u64 val)
 {
        return (blkid_swab32(val >> 32) |
                (((__u64) blkid_swab32(val & 0xFFFFFFFFUL)) << 32));
@@ -275,4 +275,6 @@ _INLINE_ u64 blkid_swab64(__u64 val)
 #define blkid_be64(x) blkid_swab64(x)
 #endif
 
+#undef _INLINE_
+
 #endif /* _BLKID_PROBE_H */
index 2a1bce259aa34a633f5e0609940d4995b56b7326..45fc6bc7f17d472bc7e1bcc1928fb850115e092d 100644 (file)
@@ -1,3 +1,19 @@
+2003-03-06  Theodore Tso  <tytso@mit.edu>
+
+       * ext2_types.h.in: Don't redefine types if other e2fsprogs
+               *_types.h files have been included already.
+
+       * kernel-jbd.h: Use C99 variadic cpp macros if not using GCC.
+               (Older GCC's don't support the C99 variadic macros.)
+
+       * flushb.c (ext2fs_sync_device), 
+       ismounted.c (ext2fs_check_mount_point): Avoid GCC extension: 
+       #warning not supported by Solaris suncc
+
+       * ext2_ext_attr.h: Avoid GCC extension: 0 length arrays in
+               structure definition.  Not needed for now in 
+               ext2_ext_attr_entry.
+
 2003-01-25  Theodore Ts'o  <tytso@mit.edu>
 
        * dirhash.c: Fix gcc -Wall nits.
index 7fff2669ab37493b2bf94f8e85ac7dfba114223e..d0a44f3f4599913b2a7acc097cf4f82f9222ae6b 100644 (file)
@@ -28,7 +28,9 @@ struct ext2_ext_attr_entry {
        __u32   e_value_block;  /* disk block attribute is stored on (n/i) */
        __u32   e_value_size;   /* size of attribute value */
        __u32   e_hash;         /* hash value of name and value */
+#if 0
        char    e_name[0];      /* attribute name */
+#endif
 };
 
 #define EXT2_EXT_ATTR_PAD_BITS         2
index 38f588f8ca5a383a2969d92c8dfcd3aab3589496..1d82c5d22dc5ab7ffe9c03f4ae820612807faf08 100644 (file)
@@ -1,11 +1,11 @@
-#ifndef _EXT2_TYPES_H
-#define _EXT2_TYPES_H
-
 /* 
  * If linux/types.h is already been included, assume it has defined
- * everything we need.  (cross fingers)
+ * everything we need.  (cross fingers)  Other header files may have 
+ * also defined the types that we need.
  */
-#ifndef _LINUX_TYPES_H
+#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \
+       !defined(_UUID_TYPES) && !defined(_EXT2_TYPES_H))
+#define _EXT2_TYPES_H
 
 typedef unsigned char __u8;
 typedef signed char __s8;
@@ -48,6 +48,4 @@ typedef       unsigned short  __u32;
  ?== error: undefined 32 bit type
 #endif
 
-#endif /* LINUX_TYPES_H */
-
-#endif /* EXT2_TYPES_H */
+#endif /* _*_TYPES_H */
index ed4d390149701af1967d17ba410c7395c5748d44..80a2117947d107e5b2f354dce5604fa512b7902b 100644 (file)
@@ -65,12 +65,16 @@ errcode_t ext2fs_sync_device(int fd, int flushb)
                if (ioctl (fd, BLKFLSBUF, 0) == 0)
                        return 0;
 #else
- #warning BLKFLSBUF not defined
+ #ifdef __GNUC__
+  #warning BLKFLSBUF not defined
+ #endif
 #endif
 #ifdef FDFLUSH
                ioctl (fd, FDFLUSH, 0);   /* In case this is a floppy */
 #else
- #warning FDFLUSH not defined
+ #ifdef __GNUC__
+  #warning FDFLUSH not defined
+ #endif
 #endif
        }
        return 0;
index 3552a1b7ff99f51b3b3e677f351fcf4fa234d562..26e8054559df16304387a9e0e2f65b0fb0dad147 100644 (file)
@@ -296,7 +296,9 @@ errcode_t ext2fs_check_mount_point(const char *device, int *mount_flags,
 #ifdef HAVE_GETMNTINFO
        return check_getmntinfo(device, mount_flags, mtpt, mtlen);
 #else
+#ifdef __GNUC__
 #warning "Can't use getmntent or getmntinfo to check for mounted filesystems!"
+#endif
        *mount_flags = 0;
        return 0;
 #endif /* HAVE_GETMNTINFO */
index 4280346683359f15ede500bd83a7da33a6c986b6..4d97b7f9137776f2ea23f65cbd3e13de80c8da20 100644 (file)
 #include <asm/semaphore.h>
 #endif
 
+#ifndef __GNUC__
+#define __FUNCTION__ ""
+#endif
+
 #define journal_oom_retry 1
 
 #ifdef __STDC__
@@ -51,7 +55,11 @@ extern int journal_enable_debug;
                }                                                       \
        } while (0)
 #else
+#ifdef __GNUC__
 #define jbd_debug(f, a...)     /**/
+#else
+#define jbd_debug(f, ...)      /**/
+#endif 
 #endif
 #else
 #define jbd_debug(x)           /* AIX doesn't do STDC */
index f23bb69a6b4a9f108b4b6ff28cb382fa3224f67c..2146e25dd5c3d7f3ee1d945e61958b937a6f1170 100644 (file)
@@ -1,3 +1,12 @@
+2003-03-06  Theodore Tso  <tytso@mit.edu>
+
+       * uuid_types.h.in: Don't redefine types if other e2fsprogs
+               *_types.h files have been included already.
+
+       * Makefile.in (tst_uuid): Link against the static library instead
+               of all of the object files, so that we automatically pick
+               up -lsocket under Solaris.
+
 2003-03-02  Theodore Ts'o  <tytso@mit.edu>
 
        * Makefile.in, uuidP.h, uuid_types.h.in: Use uuid_types.h instead
index 133b959cb0cf68c4596eab17b8d8b0a310103041..c91093ca26307bde82714bbe3a55c65aac3c3845 100644 (file)
@@ -90,8 +90,8 @@ $(top_builddir)/lib/uuid/uuid_types.h: $(srcdir)/uuid_types.h.in $(top_builddir)
 tst_uuid.o: $(srcdir)/tst_uuid.c
        $(CC) $(ALL_CFLAGS) -c $(srcdir)/tst_uuid.c -o tst_uuid.o
 
-tst_uuid: tst_uuid.o $(DEPLIBUUID)
-       $(CC) $(ALL_LDFLAGS) -o tst_uuid tst_uuid.o $(OBJS)
+tst_uuid: tst_uuid.o $(DEPSTATIC_LIBUUID)
+       $(CC) $(ALL_LDFLAGS) -o tst_uuid tst_uuid.o $(STATIC_LIBUUID)
 
 uuid_time: $(srcdir)/uuid_time.c $(DEPLIBUUID)
        $(CC) $(ALL_CFLAGS) -DDEBUG -o uuid_time $(srcdir)/uuid_time.c \
index 250d0434baf37a2316ff1b983014f1b3bce0209a..ba67feaf91b2fc3128bd0f96abba8980e71c02f8 100644 (file)
@@ -1,11 +1,11 @@
-#ifndef _UUID_TYPES_H
-#define _UUID_TYPES_H
-
 /* 
  * If linux/types.h is already been included, assume it has defined
- * everything we need.  (cross fingers)
+ * everything we need.  (cross fingers)  Other header files may have 
+ * also defined the types that we need.
  */
-#ifndef _LINUX_TYPES_H
+#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \
+       !defined(_UUID_TYPES) && !defined(_EXT2_TYPES_H))
+#define _UUID_TYPES_H
 
 typedef unsigned char __u8;
 typedef signed char __s8;
@@ -48,6 +48,4 @@ typedef       unsigned short  __u32;
  ?== error: undefined 32 bit type
 #endif
 
-#endif /* LINUX_TYPES_H */
-
-#endif /* UUID_TYPES_H */
+#endif /* _*_TYPES_H */
index d1c5dc5fb6a2394f09c56e5a3a5eb7d2e0a706b4..40f8bc415e1317a202715fb7a1b83940d8645a9c 100644 (file)
@@ -1,3 +1,8 @@
+2003-03-06  Theodore Tso  <tytso@mit.edu>
+
+       * Makefile.in (DEPLIBS_BLKID): Use DEPLIBUUID, not LIBUUID to
+               avoid depending on -lsocket on Solaris.
+
 2003-03-01  Theodore Ts'o  <tytso@mit.edu>
 
        * fsck.c, util.c, tune2fs.c, Makefile.in: Use the blkid library
index 8263a255493fee0e5f6a2ce5d2235a1376c652ae..07594795b339c14b9b12384c1f0bbc448269ff24 100644 (file)
@@ -46,7 +46,7 @@ STATIC_LIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR)
 STATIC_DEPLIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) 
 
 LIBS_BLKID= $(LIBBLKID) $(LIBUUID)
-DEPLIBS_BLKID= $(LIBBLKID) $(LIBUUID)
+DEPLIBS_BLKID= $(LIBBLKID) $(DEPLIBUUID)
 
 LIBS_E2P= $(LIBEXT2FS) $(LIBE2P) $(LIBCOM_ERR) 
 DEPLIBS_E2P= $(LIBEXT2FS) $(LIBE2P) $(LIBCOM_ERR) 
index e6cb884a753b53871d4871094bf882516268dadb..e25843d8a1d318b902319a319eb66fdb05aa4496 100644 (file)
@@ -1,3 +1,11 @@
+2003-03-06  Theodore Tso  <tytso@mit.edu>
+
+       * run_e2fsck, defaults/e_script: Solaris doesn't support "tr -d \r",
+               so use "tr -d \015" instead.
+
+       * tests/f_swapfs/script: Avoid bash'ism; Solaris doesn't support
+               put a ! character in a "if ! cmd ; then .. fi" construct.
+
 2002-11-09  Theodore Ts'o  <tytso@mit.edu>
 
        * Release of E2fsprogs 1.32
index 4f88e23e4dd6a85ea7b49136cd768f17b3725b00..3318ae71cb13d6406489de207cf1597c93f9611b 100644 (file)
@@ -29,7 +29,7 @@ else
 fi
 
 cat $SRCDIR/progs/test_data/$instance.setup $SRCDIR/progs/test_data/test.$class \
-    | $TEST_PROG -f - 2>&1 | tr -d '\r' > $OUT 
+    | $TEST_PROG -f - 2>&1 | tr -d \\015 > $OUT 
 
 cmp -s $EXPECT $OUT
 status=$?
index 9d3033dab2f209ef4d067b6ba8bc29fcb3b6bd96..c41bec7e014177a8dc758585fcf469a721e2e34e 100644 (file)
@@ -1,80 +1,79 @@
-if ! $FSCK -SV > /dev/null 2>&1 ; then
-       rm -f $test_name.ok $test_name.failed
-       echo "skipped"
-else
-
-IMAGE=$test_dir/image.gz
-VERIFY_FSCK_OPT=-yf
-SWAP_FSCK_OPT=-Sy
-NATIVE_FSCK_OPT=-sy
-OUT=$test_name.log
-EXP=$test_dir/expect
-
-gunzip < $IMAGE > $TMPFILE
-
-echo "Swapfs test" > $OUT
-
-echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new
-$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
-status=$?
-echo Exit status is $status >> $OUT.new
-sed -e '2d' $OUT.new >> $OUT
-
-echo e2fsck $SWAP_FSCK_OPT -N test_filesys > $OUT.new
-$FSCK $SWAP_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
-status=$?
-echo Exit status is $status >> $OUT.new
-sed -e '2d' $OUT.new >> $OUT
-
-echo Running debugfs.... >> $OUT
-$DEBUGFS -f $test_dir/debugfs.cmd $TMPFILE > $OUT.new 2>&1 
-status=$?
-echo Exit status is $status >> $OUT.new
-sed -e '1d' $OUT.new >> $OUT
-
-echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new
-$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
-status=$?
-echo Exit status is $status >> $OUT.new
-sed -e '2d' $OUT.new >> $OUT
-
-echo e2fsck $NATIVE_FSCK_OPT -N test_filesys > $OUT.new
-$FSCK $NATIVE_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
-status=$?
-echo Exit status is $status >> $OUT.new
-sed -e '2d' $OUT.new >> $OUT
+if $FSCK -SV > /dev/null 2>&1 ; then
+    IMAGE=$test_dir/image.gz
+    VERIFY_FSCK_OPT=-yf
+    SWAP_FSCK_OPT=-Sy
+    NATIVE_FSCK_OPT=-sy
+    OUT=$test_name.log
+    EXP=$test_dir/expect
+    
+    gunzip < $IMAGE > $TMPFILE
+    
+    echo "Swapfs test" > $OUT
+    
+    echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new
+    $FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
+    status=$?
+    echo Exit status is $status >> $OUT.new
+    sed -e '2d' $OUT.new >> $OUT
+    
+    echo e2fsck $SWAP_FSCK_OPT -N test_filesys > $OUT.new
+    $FSCK $SWAP_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
+    status=$?
+    echo Exit status is $status >> $OUT.new
+    sed -e '2d' $OUT.new >> $OUT
+    
+    echo Running debugfs.... >> $OUT
+    $DEBUGFS -f $test_dir/debugfs.cmd $TMPFILE > $OUT.new 2>&1 
+    status=$?
+    echo Exit status is $status >> $OUT.new
+    sed -e '1d' $OUT.new >> $OUT
+    
+    echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new
+    $FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
+    status=$?
+    echo Exit status is $status >> $OUT.new
+    sed -e '2d' $OUT.new >> $OUT
+    
+    echo e2fsck $NATIVE_FSCK_OPT -N test_filesys > $OUT.new
+    $FSCK $NATIVE_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
+    status=$?
+    echo Exit status is $status >> $OUT.new
+    sed -e '2d' $OUT.new >> $OUT
+    
+    echo Running debugfs.... >> $OUT
+    $DEBUGFS -f $test_dir/debugfs.cmd $TMPFILE > $OUT.new 2>&1 
+    status=$?
+    echo Exit status is $status >> $OUT.new
+    sed -e '1d' $OUT.new >> $OUT
+    
+    echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new
+    $FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
+    status=$?
+    echo Exit status is $status >> $OUT.new
+    sed -e '2d' $OUT.new >> $OUT
+    rm -f $OUT.new
+    
+    rm $TMPFILE
+    
+    #
+    # Do the verification
+    #
+    
+    rm -f $test_name.ok $test_name.failed
+    cmp -s $OUT $EXP
+    status=$?
+    
+    if [ "$status" = 0 ] ; then
+           echo "ok"
+           touch $test_name.ok
+    else
+           echo "failed"
+           diff -c $EXP $OUT > $test_name.failed
+    fi
+    
+    unset IMAGE VERIFY_FSCK_OPT SWAP_FSCK_OPT NATIVE_FSCK_OPT OUT EXP 
 
-echo Running debugfs.... >> $OUT
-$DEBUGFS -f $test_dir/debugfs.cmd $TMPFILE > $OUT.new 2>&1 
-status=$?
-echo Exit status is $status >> $OUT.new
-sed -e '1d' $OUT.new >> $OUT
-
-echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new
-$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
-status=$?
-echo Exit status is $status >> $OUT.new
-sed -e '2d' $OUT.new >> $OUT
-rm -f $OUT.new
-
-rm $TMPFILE
-
-#
-# Do the verification
-#
-
-rm -f $test_name.ok $test_name.failed
-cmp -s $OUT $EXP
-status=$?
-
-if [ "$status" = 0 ] ; then
-       echo "ok"
-       touch $test_name.ok
 else
-       echo "failed"
-       diff -c $EXP $OUT > $test_name.failed
-fi
-
-unset IMAGE VERIFY_FSCK_OPT SWAP_FSCK_OPT NATIVE_FSCK_OPT OUT EXP 
-
+    rm -f $test_name.ok $test_name.failed
+    echo "skipped"
 fi
index 44cc28522155c5dd2b7dc3755f6e42045df11144..2797ae9a5643727bcea698ae9c6e1b13b183db36 100644 (file)
@@ -33,7 +33,7 @@ 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' $OUT1.new | sed -e '/^JFS DEBUG:/d'  | tr -d '\r' > $OUT1
+sed -e '1d' $OUT1.new | sed -e '/^JFS DEBUG:/d'  | tr -d \\015 > $OUT1
 rm -f $OUT1.new
 
 if [ "$ONE_PASS_ONLY" != "true" ]; then