Fixes necessary for e2fsprogs to work using the diet libc.

- 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.
This commit is contained in:
Theodore Ts'o 2001-12-02 17:23:27 +01:00
parent b3b3d465b1
commit 571fc5a89c
10 changed files with 30 additions and 16 deletions

View 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 >

View 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

View 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);
}
/*

View 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 \

View 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>

View 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

View 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);
}

View 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 \

View 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 \