Whamcloud - gitweb
Fixes necessary for e2fsprogs to work using the diet libc.
authorTheodore Ts'o <tytso@mit.edu>
Sun, 2 Dec 2001 16:23:27 +0000 (17:23 +0100)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 2 Dec 2001 16:23:27 +0000 (17:23 +0100)
- Renamed linux/list.h to be linux/linked_list.h to work around a
  problem caused by diet libc insistence to search the kernel
  header files ahead of all other files in the include path,
  including the user specified include files.

- Worked around a bug in diet libc which core dumps when using
  putc with stderr by using fputs instead.  As a bonus, this
  also shaved a few bytes off of com_err.o.

- Fixed a real bug in debugfs which was detected because diet libc
  was more sensitive than glibc when incorrectly using fclose()
  where pclose() is required.

debugfs/ChangeLog
debugfs/Makefile.in
debugfs/util.c
e2fsck/Makefile.in
include/linux/jfs_compat.h
include/linux/linked_list.h [moved from include/linux/list.h with 100% similarity]
lib/et/ChangeLog
lib/et/com_err.c
lib/ext2fs/Makefile.in
misc/Makefile.in

index 9c03f46..70fe31d 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-02  Theodore Tso  <tytso@valinux.com>
+
+       * util.c (close_pager): Use pclose() instead of fclose() when
+               closing the pager stream.
+
 2001-11-30  Theodore Tso  <tytso@valinux.com>
 
        * debugfs.c (finish_range, dump_blocks): Fixed bug in Andreas's >
index c71f370..1cd361d 100644 (file)
@@ -74,8 +74,6 @@ distclean: clean
 # Makefile dependencies follow.  This must be the last section in
 # the Makefile.in file
 #
-debug_cmds.o: debug_cmds.c $(top_srcdir)/lib/ss/ss.h \
- $(top_builddir)/lib/ss/ss_err.h
 debugfs.o: $(srcdir)/debugfs.c $(top_srcdir)/lib/et/com_err.h \
  $(top_srcdir)/lib/ss/ss.h $(top_builddir)/lib/ss/ss_err.h \
  $(srcdir)/debugfs.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
@@ -123,4 +121,4 @@ logdump.o: $(srcdir)/logdump.c $(srcdir)/debugfs.h \
  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
  $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/jfs_user.h \
  $(top_srcdir)/include/linux/jfs.h $(top_srcdir)/include/linux/jfs_compat.h \
- $(top_srcdir)/include/linux/list.h
+ $(top_srcdir)/include/linux/linked_list.h
index fc328be..6fcbac2 100644 (file)
@@ -34,7 +34,7 @@ FILE *open_pager(void)
 
 void close_pager(FILE *stream)
 {
-       if (stream && stream != stdout) fclose(stream);
+       if (stream && stream != stdout) pclose(stream);
 }
 
 /*
index 8f7fcb0..55394de 100644 (file)
@@ -219,20 +219,23 @@ journal.o: $(srcdir)/journal.c $(srcdir)/jfs_user.h $(srcdir)/e2fsck.h \
  $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
  $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/include/linux/jfs.h \
- $(top_srcdir)/include/linux/jfs_compat.h $(top_srcdir)/include/linux/list.h \
- $(srcdir)/problem.h $(top_srcdir)/lib/uuid/uuid.h
+ $(top_srcdir)/include/linux/jfs_compat.h \
+ $(top_srcdir)/include/linux/linked_list.h $(srcdir)/problem.h \
+ $(top_srcdir)/lib/uuid/uuid.h
 recovery.o: $(srcdir)/recovery.c $(srcdir)/jfs_user.h $(srcdir)/e2fsck.h \
  $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
  $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
  $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/include/linux/jfs.h \
- $(top_srcdir)/include/linux/jfs_compat.h $(top_srcdir)/include/linux/list.h
+ $(top_srcdir)/include/linux/jfs_compat.h \
+ $(top_srcdir)/include/linux/linked_list.h
 revoke.o: $(srcdir)/revoke.c $(srcdir)/jfs_user.h $(srcdir)/e2fsck.h \
  $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
  $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
  $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/include/linux/jfs.h \
- $(top_srcdir)/include/linux/jfs_compat.h $(top_srcdir)/include/linux/list.h
+ $(top_srcdir)/include/linux/jfs_compat.h \
+ $(top_srcdir)/include/linux/linked_list.h
 badblocks.o: $(srcdir)/badblocks.c $(top_srcdir)/lib/et/com_err.h \
  $(srcdir)/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
  $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
index 1318198..7a78e4c 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef _JFS_COMPAT_H
 #define _JFS_COMPAT_H
 
-#include <linux/list.h>
+#include "linked_list.h"
 #include <errno.h>
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
index a8fec3c..e9b923c 100644 (file)
@@ -1,3 +1,10 @@
+2001-12-02  Theodore Tso  <tytso@valinux.com>
+
+       * com_err.c (default_com_err_proc): Work around bug in diet libc
+               which core dumps when using fputc on stderr; besides, it
+               shaves bytes off of com_err.o if we use fputs instead of
+               two fputc calls.
+
 2001-09-20  Theodore Tso  <tytso@thunk.org>
 
        * Release of E2fsprogs 1.25
index 81a70cf..9637b04 100644 (file)
@@ -44,9 +44,8 @@ static void
     if (fmt) {
         vfprintf (stderr, fmt, args);
     }
-    /* should do this only on a tty in raw mode */
-    putc('\r', stderr);
-    putc('\n', stderr);
+    /* should output \r only if using a tty in raw mode */
+    fputs("\r\n", stderr);
     fflush(stderr);
 }
 
index d301d98..8bd7ea7 100644 (file)
@@ -393,7 +393,8 @@ mkjournal.o: $(srcdir)/mkjournal.c $(srcdir)/ext2_fs.h \
  $(srcdir)/ext2fs.h $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
  $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/bitops.h \
  $(srcdir)/jfs_user.h $(top_srcdir)/include/linux/jfs.h \
- $(top_srcdir)/include/linux/jfs_compat.h $(top_srcdir)/include/linux/list.h
+ $(top_srcdir)/include/linux/jfs_compat.h \
+ $(top_srcdir)/include/linux/linked_list.h
 namei.o: $(srcdir)/namei.c $(srcdir)/ext2_fs.h \
  $(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/ext2fs.h \
  $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
index 0e045d0..bd53969 100644 (file)
@@ -199,8 +199,9 @@ tune2fs.o: $(srcdir)/tune2fs.c $(top_srcdir)/lib/ext2fs/ext2_fs.h \
  $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h \
  $(top_srcdir)/lib/uuid/uuid.h $(top_srcdir)/lib/e2p/e2p.h \
  $(srcdir)/jfs_user.h $(top_srcdir)/include/linux/jfs.h \
- $(top_srcdir)/include/linux/jfs_compat.h $(top_srcdir)/include/linux/list.h \
- $(srcdir)/util.h $(srcdir)/get_device_by_label.h $(top_srcdir)/version.h \
+ $(top_srcdir)/include/linux/jfs_compat.h \
+ $(top_srcdir)/include/linux/linked_list.h $(srcdir)/util.h \
+ $(srcdir)/get_device_by_label.h $(top_srcdir)/version.h \
  $(srcdir)/nls-enable.h
 mklost+found.o: $(srcdir)/mklost+found.c $(top_srcdir)/lib/ext2fs/ext2_fs.h \
  $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/version.h \
@@ -223,7 +224,7 @@ dumpe2fs.o: $(srcdir)/dumpe2fs.c $(top_srcdir)/lib/ext2fs/ext2_fs.h \
  $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h \
  $(top_srcdir)/lib/e2p/e2p.h $(srcdir)/jfs_user.h \
  $(top_srcdir)/include/linux/jfs.h $(top_srcdir)/include/linux/jfs_compat.h \
- $(top_srcdir)/include/linux/list.h $(top_srcdir)/version.h \
+ $(top_srcdir)/include/linux/linked_list.h $(top_srcdir)/version.h \
  $(srcdir)/nls-enable.h
 badblocks.o: $(srcdir)/badblocks.c $(top_srcdir)/lib/et/com_err.h \
  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \