From 73f17cfc391221a5466e95c9dc1802564ce38973 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 4 Jan 1999 07:35:45 +0000 Subject: [PATCH] ChangeLog, unix.c: unix.c (main): Reset the context before calling ext2fs_close(), to avoid referencing already freed memory. ChangeLog, llseek.c: llseek.c (ext2fs_llseek): Change ext2fs_llseek() in the non-Linux case to use EINVAL by default, unless it isn't defined, in which case we use EXT2_ET_INVALID_ARGUMENT instead. ChangeLog, mk_cmds.sh.in: mk_cmds.sh.in: Fixed portability bug in shell script; we were depending on a bash'ism. ChangeLog, uuid.c: uuid.c: Use asm/types.h instead of linux/types.h, to be consistent with other locations where we've had to do this to work around glibc. --- e2fsck/ChangeLog | 5 +++++ e2fsck/unix.c | 2 +- lib/e2p/ChangeLog | 6 ++++++ lib/e2p/uuid.c | 2 +- lib/ext2fs/ChangeLog | 7 +++++++ lib/ext2fs/llseek.c | 6 +++++- lib/ss/ChangeLog | 5 +++++ lib/ss/mk_cmds.sh.in | 2 +- 8 files changed, 31 insertions(+), 4 deletions(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 45bb6d51..481f3728 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,8 @@ +Mon Jan 4 02:28:59 1999 Theodore Y. Ts'o + + * unix.c (main): Reset the context before calling ext2fs_close(), + to avoid referencing already freed memory. + 1998-12-15 Theodore Ts'o * Release of E2fsprogs 1.13 diff --git a/e2fsck/unix.c b/e2fsck/unix.c index e17d5a3b..279849f3 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -646,7 +646,6 @@ restart: run_result = e2fsck_run(ctx); if (run_result == E2F_FLAG_RESTART) { - ext2fs_close(fs); printf("Restarting e2fsck from the beginning...\n"); retval = e2fsck_reset_context(ctx); if (retval) { @@ -654,6 +653,7 @@ restart: "while resetting context"); exit(1); } + ext2fs_close(fs); goto restart; } if (run_result & E2F_FLAG_SIGNAL_MASK) diff --git a/lib/e2p/ChangeLog b/lib/e2p/ChangeLog index d80f412e..fcaf906d 100644 --- a/lib/e2p/ChangeLog +++ b/lib/e2p/ChangeLog @@ -1,3 +1,9 @@ +Mon Jan 4 02:34:53 1999 Theodore Y. Ts'o + + * uuid.c: Use asm/types.h instead of linux/types.h, to be + consistent with other locations where we've had to do this + to work around glibc. + 1998-12-15 Theodore Ts'o * Release of E2fsprogs 1.13 diff --git a/lib/e2p/uuid.c b/lib/e2p/uuid.c index 39082a68..1dbfc590 100644 --- a/lib/e2p/uuid.c +++ b/lib/e2p/uuid.c @@ -4,7 +4,7 @@ #include #include -#include +#include #include "e2p.h" diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 2b08e7cb..04fdb369 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,10 @@ +Mon Jan 4 02:32:09 1999 Theodore Y. Ts'o + + * llseek.c (ext2fs_llseek): Change ext2fs_llseek() in the + non-Linux case to use EINVAL by default, unless it isn't + defined, in which case we use EXT2_ET_INVALID_ARGUMENT + instead. + 1998-12-15 Theodore Ts'o * Release of E2fsprogs 1.13 diff --git a/lib/ext2fs/llseek.c b/lib/ext2fs/llseek.c index 5fd35596..d75f42db 100644 --- a/lib/ext2fs/llseek.c +++ b/lib/ext2fs/llseek.c @@ -109,11 +109,15 @@ ext2_loff_t ext2fs_llseek (int fd, ext2_loff_t offset, int origin) #else /* !linux */ +#ifndef EINVAL +#define EINVAL EXT2_ET_INVALID_ARGUMENT +#endif + ext2_loff_t ext2fs_llseek (int fd, ext2_loff_t offset, int origin) { if ((sizeof(off_t) < sizeof(ext2_loff_t)) && (offset >= ((ext2_loff_t) 1 << ((sizeof(off_t)*8) -1)))) { - errno = EXT2_ET_INVALID_ARGUMENT; + errno = EINVAL; return -1; } return lseek (fd, (off_t) offset, origin); diff --git a/lib/ss/ChangeLog b/lib/ss/ChangeLog index c763b721..225a84c2 100644 --- a/lib/ss/ChangeLog +++ b/lib/ss/ChangeLog @@ -1,3 +1,8 @@ +Mon Jan 4 00:05:14 1999 Theodore Y. Ts'o + + * mk_cmds.sh.in (TMP): Fixed portability bug in shell script; we + were depending on a bash'ism. + 1998-12-15 Theodore Ts'o * Release of E2fsprogs 1.13 diff --git a/lib/ss/mk_cmds.sh.in b/lib/ss/mk_cmds.sh.in index 9ffaa9db..9ac9ce99 100644 --- a/lib/ss/mk_cmds.sh.in +++ b/lib/ss/mk_cmds.sh.in @@ -26,7 +26,7 @@ ROOT=`echo $1 | sed -e s/.ct$//` BASE=`basename $ROOT` TMP=ct$$.c -if ! test -f $FILE ; then +if test ! -f $FILE ; then echo "$FILE: File not found" exit 1; fi