From 17dba281a042d3f8122ef7ce6933035a8eae074a Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 30 Mar 1998 01:16:26 +0000 Subject: [PATCH] ChangeLog, e2fsck.h, pass4.c, super.c: super.c, e2fsck.h: Always declare e2fsck_get_device_size() as an extern in e2fsck.h to prevent -Wall warnings. pass4.c (e2fsck_pass4): Remove unused variable 'j'. super.c (check_super_block): Fix broken superblock sanity check when calculating blocks_per_group if s_log_frag_size != s_log_block_size. Since we don't support fragments, this isn't a bug deal, but it's good to get it fixed. ChangeLog, Makefile.elf-lib: Makefile.elf-lib (installdirs): Change use of DLL_INSTALL_DIR to ELF_INSTALL_DIR. (Doesn't make a difference currently, but it's correct this way.) ChangeLog, fgetversion.c, getversion.c: getversion.c (getversion): Return 0 if there's no error. fgetversion.c (fgetversion): Pass the address of the temporary variable instead of the unitialized variable to the EXT2_IOC_GETVERSION ioctl. --- e2fsck/ChangeLog | 14 ++++++++++++++ e2fsck/e2fsck.h | 1 + e2fsck/pass4.c | 2 +- e2fsck/super.c | 6 ++---- lib/ChangeLog | 6 ++++++ lib/Makefile.elf-lib | 6 +++--- lib/e2p/ChangeLog | 8 ++++++++ lib/e2p/fgetversion.c | 2 +- lib/e2p/getversion.c | 1 + 9 files changed, 37 insertions(+), 9 deletions(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 4d7b72f..63513a8 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,17 @@ +1998-03-29 Theodore Ts'o + + * super.c, e2fsck.h: Always declare e2fsck_get_device_size() as an + extern in e2fsck.h to prevent -Wall warnings. + + * pass4.c (e2fsck_pass4): Remove unused variable 'j'. + +1998-03-28 Theodore Ts'o + + * super.c (check_super_block): Fix broken superblock sanity check + when calculating blocks_per_group if s_log_frag_size != + s_log_block_size. Since we don't support fragments, this + isn't a bug deal, but it's good to get it fixed. + 1998-03-23 Theodore Ts'o * unix.c: Fix bug in check of feature set, to make sure we can diff --git a/e2fsck/e2fsck.h b/e2fsck/e2fsck.h index e1c5944..efb7549 100644 --- a/e2fsck/e2fsck.h +++ b/e2fsck/e2fsck.h @@ -261,6 +261,7 @@ extern void ehandler_init(io_channel channel); /* super.c */ void check_super_block(e2fsck_t ctx); +errcode_t e2fsck_get_device_size(e2fsck_t ctx); /* swapfs.c */ void swap_filesys(e2fsck_t ctx); diff --git a/e2fsck/pass4.c b/e2fsck/pass4.c index 1cb7449..f65785a 100644 --- a/e2fsck/pass4.c +++ b/e2fsck/pass4.c @@ -85,7 +85,7 @@ void e2fsck_pass4(e2fsck_t ctx) #endif struct problem_context pctx; __u16 link_count, link_counted; - int group, max, j; + int group, max; #ifdef RESOURCE_TRACK init_resource_track(&rtrack); diff --git a/e2fsck/super.c b/e2fsck/super.c index 5c0e54d..62038be 100644 --- a/e2fsck/super.c +++ b/e2fsck/super.c @@ -62,8 +62,6 @@ errcode_t e2fsck_get_device_size(e2fsck_t ctx) EXT2_BLOCK_SIZE(ctx->fs->super), &ctx->num_blocks)); } -#else -extern errcode_t e2fsck_get_device_size(e2fsck_t ctx); #endif void check_super_block(e2fsck_t ctx) @@ -134,8 +132,8 @@ void check_super_block(e2fsck_t ctx) return; } - should_be = s->s_frags_per_group / - (s->s_log_block_size - s->s_log_frag_size + 1); + should_be = s->s_frags_per_group >> + (s->s_log_block_size - s->s_log_frag_size); if (s->s_blocks_per_group != should_be) { pctx.blk = s->s_blocks_per_group; pctx.blk2 = should_be; diff --git a/lib/ChangeLog b/lib/ChangeLog index 38152b1..b77f8eb 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +1998-03-28 Theodore Ts'o + + * Makefile.elf-lib (installdirs): Change use of DLL_INSTALL_DIR to + ELF_INSTALL_DIR. (Doesn't make a difference currently, + but it's correct this way.) + Tue Jun 17 01:33:20 1997 Theodore Ts'o * Release of E2fsprogs 1.11 diff --git a/lib/Makefile.elf-lib b/lib/Makefile.elf-lib index 4804d48..de38bfd 100644 --- a/lib/Makefile.elf-lib +++ b/lib/Makefile.elf-lib @@ -41,9 +41,9 @@ installdirs:: installdirs-elf-lib install-shlibs install:: $(ELF_LIB) installdirs-elf-lib $(INSTALL_PROGRAM) $(ELF_LIB) $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB) $(STRIP) --strip-debug \ - $(DESTDIR)$(DLL_INSTALL_DIR)/$(ELF_LIB) - $(LN_S) -f $(ELF_LIB) $(DESTDIR)$(DLL_INSTALL_DIR)/$(ELF_SONAME) - $(LN_S) -f $(DLL_INSTALL_DIR)/$(ELF_SONAME) \ + $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB) + $(LN_S) -f $(ELF_LIB) $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_SONAME) + $(LN_S) -f $(ELF_INSTALL_DIR)/$(ELF_SONAME) \ $(DESTDIR)$(ulibdir)/$(ELF_IMAGE).so -ldconfig diff --git a/lib/e2p/ChangeLog b/lib/e2p/ChangeLog index e05fe2e..013ad9f 100644 --- a/lib/e2p/ChangeLog +++ b/lib/e2p/ChangeLog @@ -1,3 +1,11 @@ +1998-03-29 Theodore Ts'o + + * getversion.c (getversion): Return 0 if there's no error. + + * fgetversion.c (fgetversion): Pass the address of the temporary + variable instead of the unitialized variable to the + EXT2_IOC_GETVERSION ioctl. + Mon Mar 9 08:05:30 1998 Theodore Ts'o * fgetflags.c, fgetversion.c, fsetflags.c, fsetversion.c, diff --git a/lib/e2p/fgetversion.c b/lib/e2p/fgetversion.c index 525081e..1493eac 100644 --- a/lib/e2p/fgetversion.c +++ b/lib/e2p/fgetversion.c @@ -33,7 +33,7 @@ int fgetversion (const char * name, unsigned long * version) fd = open (name, O_RDONLY|O_NONBLOCK); if (fd == -1) return - 1; - r = ioctl (fd, EXT2_IOC_GETVERSION, ver); + r = ioctl (fd, EXT2_IOC_GETVERSION, &ver); *version = ver; close (fd); return r; diff --git a/lib/e2p/getversion.c b/lib/e2p/getversion.c index 4eb5d4c..38b7d0f 100644 --- a/lib/e2p/getversion.c +++ b/lib/e2p/getversion.c @@ -28,6 +28,7 @@ int getversion (int fd, unsigned long * version) r = ioctl (fd, EXT2_IOC_GETVERSION, &ver); *version = ver; + return 0; #else /* ! HAVE_EXT2_IOCTLS */ extern int errno; errno = EOPNOTSUPP; -- 1.8.3.1