aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2003-03-06 11:09:18 -0500
committerTheodore Ts'o <tytso@mit.edu>2003-03-06 11:09:18 -0500
commited78c021c3b111d8ab9a51aef5d5156e3004083f (patch)
tree8d9e92fb9a9bdb535ed06e67bc8981f63e56d67f
parent94ba8c750604d8d2487841a06cb930dd5f3bb43b (diff)
downloade2fsprogs-ed78c021c3b111d8ab9a51aef5d5156e3004083f.tar.gz
Fix up lots of portability problems that caused e2fsprogs not to build successfully
under Solaris.
-rw-r--r--ChangeLog5
-rw-r--r--Makefile.in1
-rw-r--r--debugfs/ChangeLog7
-rw-r--r--debugfs/debugfs.c4
-rw-r--r--debugfs/dump.c2
-rw-r--r--debugfs/htree.c4
-rw-r--r--debugfs/logdump.c2
-rw-r--r--debugfs/ls.c2
-rw-r--r--doc/ChangeLog5
-rw-r--r--doc/Makefile.in4
-rw-r--r--lib/blkid/ChangeLog15
-rw-r--r--lib/blkid/Makefile.in26
-rw-r--r--lib/blkid/blkid_types.h.in14
-rw-r--r--lib/blkid/devname.c5
-rw-r--r--lib/blkid/list.h24
-rw-r--r--lib/blkid/probe.h14
-rw-r--r--lib/ext2fs/ChangeLog16
-rw-r--r--lib/ext2fs/ext2_ext_attr.h2
-rw-r--r--lib/ext2fs/ext2_types.h.in14
-rw-r--r--lib/ext2fs/flushb.c8
-rw-r--r--lib/ext2fs/ismounted.c2
-rw-r--r--lib/ext2fs/kernel-jbd.h8
-rw-r--r--lib/uuid/ChangeLog9
-rw-r--r--lib/uuid/Makefile.in4
-rw-r--r--lib/uuid/uuid_types.h.in14
-rw-r--r--misc/ChangeLog5
-rw-r--r--misc/Makefile.in2
-rw-r--r--tests/ChangeLog8
-rw-r--r--tests/defaults/e_script2
-rw-r--r--tests/f_swapfs/script153
-rw-r--r--tests/run_e2fsck2
31 files changed, 237 insertions, 146 deletions
diff --git a/ChangeLog b/ChangeLog
index f7abf75b..013f10aa 100644
--- 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
diff --git a/Makefile.in b/Makefile.in
index edf08053..34128e8c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -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
diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog
index 184ab2aa..88583a61 100644
--- a/debugfs/ChangeLog
+++ b/debugfs/ChangeLog
@@ -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
diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index 22941046..a9a6c63d 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -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
diff --git a/debugfs/dump.c b/debugfs/dump.c
index e9227f0f..303f7e18 100644
--- a/debugfs/dump.c
+++ b/debugfs/dump.c
@@ -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
diff --git a/debugfs/htree.c b/debugfs/htree.c
index 13c0916d..b9403d97 100644
--- a/debugfs/htree.c
+++ b/debugfs/htree.c
@@ -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
diff --git a/debugfs/logdump.c b/debugfs/logdump.c
index df11c162..1e195ba9 100644
--- a/debugfs/logdump.c
+++ b/debugfs/logdump.c
@@ -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
diff --git a/debugfs/ls.c b/debugfs/ls.c
index 3064598d..a66482dc 100644
--- a/debugfs/ls.c
+++ b/debugfs/ls.c
@@ -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
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 87fb8459..430b5cda 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -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
diff --git a/doc/Makefile.in b/doc/Makefile.in
index e402d9e7..f3f11f2e 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -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
diff --git a/lib/blkid/ChangeLog b/lib/blkid/ChangeLog
index 88963e30..a5b06a6c 100644
--- a/lib/blkid/ChangeLog
+++ b/lib/blkid/ChangeLog
@@ -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
diff --git a/lib/blkid/Makefile.in b/lib/blkid/Makefile.in
index 58bc8331..05574e70 100644
--- a/lib/blkid/Makefile.in
+++ b/lib/blkid/Makefile.in
@@ -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
diff --git a/lib/blkid/blkid_types.h.in b/lib/blkid/blkid_types.h.in
index 1fb4d27a..9de6804e 100644
--- a/lib/blkid/blkid_types.h.in
+++ b/lib/blkid/blkid_types.h.in
@@ -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 */
diff --git a/lib/blkid/devname.c b/lib/blkid/devname.c
index 27a9d0c0..df770018 100644
--- a/lib/blkid/devname.c
+++ b/lib/blkid/devname.c
@@ -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;
diff --git a/lib/blkid/list.h b/lib/blkid/list.h
index 7800a464..c1cbfec5 100644
--- a/lib/blkid/list.h
+++ b/lib/blkid/list.h
@@ -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
diff --git a/lib/blkid/probe.h b/lib/blkid/probe.h
index 391428ca..8302b3f4 100644
--- a/lib/blkid/probe.h
+++ b/lib/blkid/probe.h
@@ -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 */
diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog
index 2a1bce25..45fc6bc7 100644
--- a/lib/ext2fs/ChangeLog
+++ b/lib/ext2fs/ChangeLog
@@ -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.
diff --git a/lib/ext2fs/ext2_ext_attr.h b/lib/ext2fs/ext2_ext_attr.h
index 7fff2669..d0a44f3f 100644
--- a/lib/ext2fs/ext2_ext_attr.h
+++ b/lib/ext2fs/ext2_ext_attr.h
@@ -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
diff --git a/lib/ext2fs/ext2_types.h.in b/lib/ext2fs/ext2_types.h.in
index 38f588f8..1d82c5d2 100644
--- a/lib/ext2fs/ext2_types.h.in
+++ b/lib/ext2fs/ext2_types.h.in
@@ -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 */
diff --git a/lib/ext2fs/flushb.c b/lib/ext2fs/flushb.c
index ed4d3901..80a21179 100644
--- a/lib/ext2fs/flushb.c
+++ b/lib/ext2fs/flushb.c
@@ -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;
diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c
index 3552a1b7..26e80545 100644
--- a/lib/ext2fs/ismounted.c
+++ b/lib/ext2fs/ismounted.c
@@ -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 */
diff --git a/lib/ext2fs/kernel-jbd.h b/lib/ext2fs/kernel-jbd.h
index 42803466..4d97b7f9 100644
--- a/lib/ext2fs/kernel-jbd.h
+++ b/lib/ext2fs/kernel-jbd.h
@@ -30,6 +30,10 @@
#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 */
diff --git a/lib/uuid/ChangeLog b/lib/uuid/ChangeLog
index f23bb69a..2146e25d 100644
--- a/lib/uuid/ChangeLog
+++ b/lib/uuid/ChangeLog
@@ -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
diff --git a/lib/uuid/Makefile.in b/lib/uuid/Makefile.in
index 133b959c..c91093ca 100644
--- a/lib/uuid/Makefile.in
+++ b/lib/uuid/Makefile.in
@@ -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 \
diff --git a/lib/uuid/uuid_types.h.in b/lib/uuid/uuid_types.h.in
index 250d0434..ba67feaf 100644
--- a/lib/uuid/uuid_types.h.in
+++ b/lib/uuid/uuid_types.h.in
@@ -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 */
diff --git a/misc/ChangeLog b/misc/ChangeLog
index d1c5dc5f..40f8bc41 100644
--- a/misc/ChangeLog
+++ b/misc/ChangeLog
@@ -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
diff --git a/misc/Makefile.in b/misc/Makefile.in
index 8263a255..07594795 100644
--- a/misc/Makefile.in
+++ b/misc/Makefile.in
@@ -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)
diff --git a/tests/ChangeLog b/tests/ChangeLog
index e6cb884a..e25843d8 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -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
diff --git a/tests/defaults/e_script b/tests/defaults/e_script
index 4f88e23e..3318ae71 100644
--- a/tests/defaults/e_script
+++ b/tests/defaults/e_script
@@ -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=$?
diff --git a/tests/f_swapfs/script b/tests/f_swapfs/script
index 9d3033da..c41bec7e 100644
--- a/tests/f_swapfs/script
+++ b/tests/f_swapfs/script
@@ -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
diff --git a/tests/run_e2fsck b/tests/run_e2fsck
index 44cc2852..2797ae9a 100644
--- a/tests/run_e2fsck
+++ b/tests/run_e2fsck
@@ -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