aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>1997-12-01 18:24:10 +0000
committerTheodore Ts'o <tytso@mit.edu>1997-12-01 18:24:10 +0000
commit5be8dc2143c7b3b21a9b8fb56797dd855ee87560 (patch)
treec05a66556a187b90c0bd8cab1429f04cd3587967
parent134ea28aaf76a3497361c99e115ff666b0c000b8 (diff)
downloade2fsprogs-5be8dc2143c7b3b21a9b8fb56797dd855ee87560.tar.gz
Many files:
dblist.c (ext2fs_get_num_dirs): Make ext2fs_get_num_dirs more paranoid about validating the directory counts from the block group information. all files: Don't include stdlib.h anymore; include it in ext2_fs.h, since that file requires stdlib.h ChangeLog, Makefile.in, dirinfo.c: dirinfo.c (e2fsck_add_dir_info): Use ext2fs_get_num_dirs instead of e2fsck_get_num_dirs, which has been removed. Makefile.in (PROGS): Remove @EXTRA_PROGS@, since we don't want to compile and install flushb. ChangeLog, configure.in: Remove @EXTRA_PROGS@, since we aren't using it in 2fsck/Makefile.in anymore ChangeLog, Makefile.in: Install debugfs in /sbin, instead of /usr/sbin. libext2fs.texinfo: Update version string to be 1.12 Makefile.in: Fix bug in find script which made the exclusion list, where a '-' was missing from an -name option.
-rw-r--r--ChangeLog5
-rw-r--r--Makefile.in2
-rw-r--r--configure.in4
-rw-r--r--debugfs/ChangeLog4
-rw-r--r--debugfs/Makefile.in4
-rw-r--r--doc/libext2fs.texinfo6
-rw-r--r--e2fsck/ChangeLog10
-rw-r--r--e2fsck/Makefile.in2
-rw-r--r--e2fsck/dirinfo.c19
-rw-r--r--lib/ext2fs/ChangeLog9
-rw-r--r--lib/ext2fs/alloc.c1
-rw-r--r--lib/ext2fs/alloc_tables.c1
-rw-r--r--lib/ext2fs/badblocks.c1
-rw-r--r--lib/ext2fs/bb_compat.c1
-rw-r--r--lib/ext2fs/bb_inode.c1
-rw-r--r--lib/ext2fs/bitmaps.c1
-rw-r--r--lib/ext2fs/block.c1
-rw-r--r--lib/ext2fs/bmap.c1
-rw-r--r--lib/ext2fs/bmove.c1
-rw-r--r--lib/ext2fs/brel_ma.c1
-rw-r--r--lib/ext2fs/check_desc.c1
-rw-r--r--lib/ext2fs/closefs.c1
-rw-r--r--lib/ext2fs/cmp_bitmaps.c1
-rw-r--r--lib/ext2fs/dblist.c14
-rw-r--r--lib/ext2fs/dblist_dir.c1
-rw-r--r--lib/ext2fs/dir_iterate.c1
-rw-r--r--lib/ext2fs/dirblock.c1
-rw-r--r--lib/ext2fs/dosio.c1
-rw-r--r--lib/ext2fs/dupfs.c1
-rw-r--r--lib/ext2fs/expanddir.c1
-rw-r--r--lib/ext2fs/ext2fs.h1
-rw-r--r--lib/ext2fs/fileio.c1
-rw-r--r--lib/ext2fs/freefs.c1
-rw-r--r--lib/ext2fs/get_pathname.c1
-rw-r--r--lib/ext2fs/getsize.c3
-rw-r--r--lib/ext2fs/icount.c1
-rw-r--r--lib/ext2fs/initialize.c1
-rw-r--r--lib/ext2fs/inline.c1
-rw-r--r--lib/ext2fs/inode.c1
-rw-r--r--lib/ext2fs/irel_ma.c1
-rw-r--r--lib/ext2fs/ismounted.c3
-rw-r--r--lib/ext2fs/link.c1
-rw-r--r--lib/ext2fs/llseek.c1
-rw-r--r--lib/ext2fs/lookup.c1
-rw-r--r--lib/ext2fs/mkdir.c1
-rw-r--r--lib/ext2fs/namei.c1
-rw-r--r--lib/ext2fs/newdir.c1
-rw-r--r--lib/ext2fs/openfs.c3
-rw-r--r--lib/ext2fs/read_bb.c1
-rw-r--r--lib/ext2fs/read_bb_file.c1
-rw-r--r--lib/ext2fs/rs_bitmap.c1
-rw-r--r--lib/ext2fs/rw_bitmaps.c1
-rw-r--r--lib/ext2fs/swapfs.c1
-rw-r--r--lib/ext2fs/test_io.c1
-rw-r--r--lib/ext2fs/tst_badblocks.c1
-rw-r--r--lib/ext2fs/tst_getsize.c1
-rw-r--r--lib/ext2fs/tst_iscan.c1
-rw-r--r--lib/ext2fs/unix_io.c5
-rw-r--r--lib/ext2fs/unlink.c1
-rw-r--r--lib/ext2fs/valid_blk.c1
-rw-r--r--lib/ext2fs/version.c1
61 files changed, 53 insertions, 86 deletions
diff --git a/ChangeLog b/ChangeLog
index c36ea455..f7634117 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Nov 25 15:56:29 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * configure.in: Remove @EXTRA_PROGS@, since we aren't using it in
+ e2fsck/Makefile.in.
+
Tue Nov 4 10:46:18 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
* configure.in: Add check for setjmp.h
diff --git a/Makefile.in b/Makefile.in
index c20efdd6..11c92c69 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -100,7 +100,7 @@ SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
$(srcdir)/.exclude-file:
a=$(SRCROOT); \
(cd $(srcdir)/.. ; find e2fsprogs \( -name \*~ -o -name \*.orig \
- -o -name CVS -o -name \*.rej -o name Makefile.pq \) -print) \
+ -o -name CVS -o -name \*.rej -o -name Makefile.pq \) -print) \
| sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-file
echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
diff --git a/configure.in b/configure.in
index 2bc42ee9..8b5f4b55 100644
--- a/configure.in
+++ b/configure.in
@@ -408,12 +408,8 @@ dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
dnl is quoted so that it gets expanded by make, not by configure.
dnl
AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
-AC_SUBST(EXTRA_PROGS)
if test "$linux_headers" = yes; then
AC_DEFINE(HAVE_LINUX_FS_H)
- # These are some programs that depend on having linux headers around, and
- # won't work otherwise. So we only compile them if we can.
- EXTRA_PROGS="$EXTRA_PROGS flushb"
else
LINUX_INCLUDE='-I$(top_srcdir)/include -I$(top_builddir)/include'
# Use this include directory with test compiles in the configure script too.
diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog
index edbccd1d..ce82acf9 100644
--- a/debugfs/ChangeLog
+++ b/debugfs/ChangeLog
@@ -1,3 +1,7 @@
+Mon Dec 1 13:21:09 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * Makefile.in: Install debugfs in /sbin, instead of /usr/sbin.
+
Sat Oct 25 18:35:30 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
* debugfs.c (copy_file), dump.c (dump_file): Change to use the new
diff --git a/debugfs/Makefile.in b/debugfs/Makefile.in
index 4dec9622..b52d9e76 100644
--- a/debugfs/Makefile.in
+++ b/debugfs/Makefile.in
@@ -45,8 +45,8 @@ installdirs:
install: $(PROGS) $(MANPAGES) installdirs
for i in $(PROGS); do \
- $(INSTALL_PROGRAM) $$i $(DESTDIR)$(usbindir)/$$i; \
- $(STRIP) $(DESTDIR)$(usbindir)/$$i; \
+ $(INSTALL_PROGRAM) $$i $(DESTDIR)$(sbindir)/$$i; \
+ $(STRIP) $(DESTDIR)$(sbindir)/$$i; \
done
for i in $(MANPAGES); do \
$(INSTALL_DATA) $$i $(DESTDIR)$(man8dir)/$$i; \
diff --git a/doc/libext2fs.texinfo b/doc/libext2fs.texinfo
index d9c2ef19..ffb70ebb 100644
--- a/doc/libext2fs.texinfo
+++ b/doc/libext2fs.texinfo
@@ -1,7 +1,7 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename libext2fs.info
-@settitle The EXT2FS Library (version 1.11)
+@settitle The EXT2FS Library (version 1.12)
@synindex tp fn
@comment %**end of header
@@ -60,7 +60,7 @@ by the author.
@title The EXT2FS Library
@subtitle The EXT2FS Library
-@subtitle Version 1.11
+@subtitle Version 1.12
@subtitle April 1997
@author by Theodore Ts'o
@@ -101,7 +101,7 @@ by the Foundation.
@top The EXT2FS Library
-This manual documents the EXT2FS Library, version 1.11.
+This manual documents the EXT2FS Library, version 1.12.
@end ifinfo
diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog
index 17a76b70..3413db64 100644
--- a/e2fsck/ChangeLog
+++ b/e2fsck/ChangeLog
@@ -1,3 +1,13 @@
+Fri Nov 28 09:30:26 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * dirinfo.c (e2fsck_add_dir_info): Use ext2fs_get_num_dirs instead
+ of e2fsck_get_num_dirs, which has been removed.
+
+Tue Nov 25 15:54:35 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * Makefile.in (PROGS): Remove @EXTRA_PROGS@, since we don't want
+ to compile and install flushb.
+
Mon Nov 24 06:48:00 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
* pass1.c (e2fsck_pass1_check_device_inode): For now, only check
diff --git a/e2fsck/Makefile.in b/e2fsck/Makefile.in
index 82acdb9a..8f12cb65 100644
--- a/e2fsck/Makefile.in
+++ b/e2fsck/Makefile.in
@@ -12,7 +12,7 @@ LDFLAG_STATIC = @LDFLAG_STATIC@
@MCONFIG@
-PROGS= e2fsck @EXTRA_PROGS@
+PROGS= e2fsck
MANPAGES= e2fsck.8
XTRA_CFLAGS= -DRESOURCE_TRACK
diff --git a/e2fsck/dirinfo.c b/e2fsck/dirinfo.c
index 38a8e437..2ab4a94e 100644
--- a/e2fsck/dirinfo.c
+++ b/e2fsck/dirinfo.c
@@ -8,18 +8,6 @@
#include <et/com_err.h>
#include "e2fsck.h"
-int e2fsck_get_num_dirs(e2fsck_t ctx)
-{
- ext2_filsys fs = ctx->fs;
- int i, num_dirs;
-
- num_dirs = 0;
- for (i = 0; i < fs->group_desc_count; i++)
- num_dirs += fs->group_desc[i].bg_used_dirs_count;
-
- return num_dirs;
-}
-
/*
* This subroutine is called during pass1 to create a directory info
* entry. During pass1, the passed-in parent is 0; it will get filled
@@ -29,6 +17,7 @@ void e2fsck_add_dir_info(e2fsck_t ctx, ino_t ino, ino_t parent)
{
struct dir_info *dir;
int i, j;
+ ino_t num_dirs;
errcode_t retval;
#if 0
@@ -36,8 +25,10 @@ void e2fsck_add_dir_info(e2fsck_t ctx, ino_t ino, ino_t parent)
#endif
if (!ctx->dir_info) {
ctx->dir_info_count = 0;
- ctx->dir_info_size = e2fsck_get_num_dirs(ctx) + 10;
-
+ retval = ext2fs_get_num_dirs(ctx->fs, &num_dirs);
+ if (retval)
+ num_dirs = 1024; /* Guess */
+ ctx->dir_info_size = num_dirs + 10;
ctx->dir_info = e2fsck_allocate_memory(ctx,
ctx->dir_info_size * sizeof (struct dir_info),
"directory map");
diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog
index e54ef4e5..bbe24785 100644
--- a/lib/ext2fs/ChangeLog
+++ b/lib/ext2fs/ChangeLog
@@ -1,3 +1,12 @@
+Fri Nov 28 09:26:31 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * dblist.c (ext2fs_get_num_dirs): Make ext2fs_get_num_dirs more
+ paranoid about validating the directory counts from the
+ block group information.
+
+ * all files: Don't include stdlib.h anymore; include it in
+ ext2_fs.h, since that file requires stdlib.h
+
Thu Nov 20 16:07:38 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
* expanddir.c (ext2fs_expand_dir): Check to make sure the block
diff --git a/lib/ext2fs/alloc.c b/lib/ext2fs/alloc.c
index 123860c9..6e7b5537 100644
--- a/lib/ext2fs/alloc.c
+++ b/lib/ext2fs/alloc.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <time.h>
#include <string.h>
#if HAVE_SYS_STAT_H
diff --git a/lib/ext2fs/alloc_tables.c b/lib/ext2fs/alloc_tables.c
index 769aec90..8c42cd7b 100644
--- a/lib/ext2fs/alloc_tables.c
+++ b/lib/ext2fs/alloc_tables.c
@@ -15,7 +15,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#if HAVE_SYS_STAT_H
diff --git a/lib/ext2fs/badblocks.c b/lib/ext2fs/badblocks.c
index ab1404dd..fba2d997 100644
--- a/lib/ext2fs/badblocks.c
+++ b/lib/ext2fs/badblocks.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#if HAVE_SYS_STAT_H
diff --git a/lib/ext2fs/bb_compat.c b/lib/ext2fs/bb_compat.c
index 4b52675c..ec4911e4 100644
--- a/lib/ext2fs/bb_compat.c
+++ b/lib/ext2fs/bb_compat.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#if HAVE_SYS_STAT_H
diff --git a/lib/ext2fs/bb_inode.c b/lib/ext2fs/bb_inode.c
index abad6753..eab5a78f 100644
--- a/lib/ext2fs/bb_inode.c
+++ b/lib/ext2fs/bb_inode.c
@@ -18,7 +18,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#if HAVE_SYS_STAT_H
diff --git a/lib/ext2fs/bitmaps.c b/lib/ext2fs/bitmaps.c
index 0887e575..e50560c5 100644
--- a/lib/ext2fs/bitmaps.c
+++ b/lib/ext2fs/bitmaps.c
@@ -15,7 +15,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#if HAVE_SYS_STAT_H
diff --git a/lib/ext2fs/block.c b/lib/ext2fs/block.c
index 29460036..c594d8d3 100644
--- a/lib/ext2fs/block.c
+++ b/lib/ext2fs/block.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <linux/ext2_fs.h>
diff --git a/lib/ext2fs/bmap.c b/lib/ext2fs/bmap.c
index 43f9f310..ec421cee 100644
--- a/lib/ext2fs/bmap.c
+++ b/lib/ext2fs/bmap.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <linux/ext2_fs.h>
diff --git a/lib/ext2fs/bmove.c b/lib/ext2fs/bmove.c
index 69722579..0a5a80c0 100644
--- a/lib/ext2fs/bmove.c
+++ b/lib/ext2fs/bmove.c
@@ -11,7 +11,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
diff --git a/lib/ext2fs/brel_ma.c b/lib/ext2fs/brel_ma.c
index 3f82a29d..c515e4a4 100644
--- a/lib/ext2fs/brel_ma.c
+++ b/lib/ext2fs/brel_ma.c
@@ -14,7 +14,6 @@
#include <fcntl.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/ext2fs/check_desc.c b/lib/ext2fs/check_desc.c
index 602753d2..0764ae4d 100644
--- a/lib/ext2fs/check_desc.c
+++ b/lib/ext2fs/check_desc.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#if HAVE_SYS_STAT_H
diff --git a/lib/ext2fs/closefs.c b/lib/ext2fs/closefs.c
index 4a880e8a..b39b15d2 100644
--- a/lib/ext2fs/closefs.c
+++ b/lib/ext2fs/closefs.c
@@ -13,7 +13,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <time.h>
#include <string.h>
diff --git a/lib/ext2fs/cmp_bitmaps.c b/lib/ext2fs/cmp_bitmaps.c
index 9cec4d77..422606b4 100644
--- a/lib/ext2fs/cmp_bitmaps.c
+++ b/lib/ext2fs/cmp_bitmaps.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#if HAVE_SYS_STAT_H
diff --git a/lib/ext2fs/dblist.c b/lib/ext2fs/dblist.c
index cdf1bef2..4c15922c 100644
--- a/lib/ext2fs/dblist.c
+++ b/lib/ext2fs/dblist.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <string.h>
#include <time.h>
@@ -32,13 +31,20 @@ static int dir_block_cmp(const void *a, const void *b);
errcode_t ext2fs_get_num_dirs(ext2_filsys fs, ino_t *ret_num_dirs)
{
int i;
- ino_t num_dirs;
+ ino_t num_dirs, max_dirs;
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
num_dirs = 0;
- for (i = 0; i < fs->group_desc_count; i++)
- num_dirs += fs->group_desc[i].bg_used_dirs_count;
+ max_dirs = 8 * fs->blocksize;
+ for (i = 0; i < fs->group_desc_count; i++) {
+ if (fs->group_desc[i].bg_used_dirs_count > max_dirs)
+ num_dirs += max_dirs;
+ else
+ num_dirs += fs->group_desc[i].bg_used_dirs_count;
+ }
+ if (num_dirs > fs->super->s_inodes_count)
+ num_dirs = fs->super->s_inodes_count;
*ret_num_dirs = num_dirs;
diff --git a/lib/ext2fs/dblist_dir.c b/lib/ext2fs/dblist_dir.c
index 2c8b8a1d..1594cdc5 100644
--- a/lib/ext2fs/dblist_dir.c
+++ b/lib/ext2fs/dblist_dir.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <string.h>
#include <time.h>
diff --git a/lib/ext2fs/dir_iterate.c b/lib/ext2fs/dir_iterate.c
index 0784ef20..725cd473 100644
--- a/lib/ext2fs/dir_iterate.c
+++ b/lib/ext2fs/dir_iterate.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#if HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/lib/ext2fs/dirblock.c b/lib/ext2fs/dirblock.c
index 0bb7cc55..85a38de3 100644
--- a/lib/ext2fs/dirblock.c
+++ b/lib/ext2fs/dirblock.c
@@ -13,7 +13,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <string.h>
#include <time.h>
diff --git a/lib/ext2fs/dosio.c b/lib/ext2fs/dosio.c
index b1d79711..c6baddb8 100644
--- a/lib/ext2fs/dosio.c
+++ b/lib/ext2fs/dosio.c
@@ -11,7 +11,6 @@
#include <stdio.h>
#include <bios.h>
#include <string.h>
-#include <stdlib.h>
#include <ctype.h>
#include <io.h>
#ifdef HAVE_ERRNO_H
diff --git a/lib/ext2fs/dupfs.c b/lib/ext2fs/dupfs.c
index f358eca2..667726dc 100644
--- a/lib/ext2fs/dupfs.c
+++ b/lib/ext2fs/dupfs.c
@@ -13,7 +13,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <time.h>
#include <string.h>
diff --git a/lib/ext2fs/expanddir.c b/lib/ext2fs/expanddir.c
index fc14ad4e..07973a46 100644
--- a/lib/ext2fs/expanddir.c
+++ b/lib/ext2fs/expanddir.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <linux/ext2_fs.h>
diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h
index f9eb34e4..f19fdbe5 100644
--- a/lib/ext2fs/ext2fs.h
+++ b/lib/ext2fs/ext2fs.h
@@ -36,6 +36,7 @@
#include <sys/types.h>
#endif
+#include <stdlib.h>
#include <linux/types.h>
typedef __u32 blk_t;
diff --git a/lib/ext2fs/fileio.c b/lib/ext2fs/fileio.c
index 4f34fde6..f0e55e14 100644
--- a/lib/ext2fs/fileio.c
+++ b/lib/ext2fs/fileio.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <linux/ext2_fs.h>
diff --git a/lib/ext2fs/freefs.c b/lib/ext2fs/freefs.c
index 71d1ef79..52a769e4 100644
--- a/lib/ext2fs/freefs.c
+++ b/lib/ext2fs/freefs.c
@@ -13,7 +13,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <linux/ext2_fs.h>
diff --git a/lib/ext2fs/get_pathname.c b/lib/ext2fs/get_pathname.c
index baa9af88..9ace71a7 100644
--- a/lib/ext2fs/get_pathname.c
+++ b/lib/ext2fs/get_pathname.c
@@ -23,7 +23,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <linux/ext2_fs.h>
diff --git a/lib/ext2fs/getsize.c b/lib/ext2fs/getsize.c
index c90708e7..a8cd59cd 100644
--- a/lib/ext2fs/getsize.c
+++ b/lib/ext2fs/getsize.c
@@ -13,9 +13,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#include <fcntl.h>
#ifdef HAVE_LINUX_FS_H
#include <linux/fs.h>
diff --git a/lib/ext2fs/icount.c b/lib/ext2fs/icount.c
index 56e50139..72ef44d7 100644
--- a/lib/ext2fs/icount.c
+++ b/lib/ext2fs/icount.c
@@ -13,7 +13,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <string.h>
#include <stdio.h>
diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c
index 1fcff190..4ab44de4 100644
--- a/lib/ext2fs/initialize.c
+++ b/lib/ext2fs/initialize.c
@@ -15,7 +15,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#if HAVE_SYS_STAT_H
diff --git a/lib/ext2fs/inline.c b/lib/ext2fs/inline.c
index 97c3d069..fc096689 100644
--- a/lib/ext2fs/inline.c
+++ b/lib/ext2fs/inline.c
@@ -17,7 +17,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#if HAVE_SYS_STAT_H
diff --git a/lib/ext2fs/inode.c b/lib/ext2fs/inode.c
index 8695ff06..d72e00cc 100644
--- a/lib/ext2fs/inode.c
+++ b/lib/ext2fs/inode.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
diff --git a/lib/ext2fs/irel_ma.c b/lib/ext2fs/irel_ma.c
index 6ff816b4..2ca6fb5c 100644
--- a/lib/ext2fs/irel_ma.c
+++ b/lib/ext2fs/irel_ma.c
@@ -11,7 +11,6 @@
#include <fcntl.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c
index 621fd188..0761ec8e 100644
--- a/lib/ext2fs/ismounted.c
+++ b/lib/ext2fs/ismounted.c
@@ -13,9 +13,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#include <fcntl.h>
#ifdef HAVE_LINUX_FS_H
#include <linux/fs.h>
diff --git a/lib/ext2fs/link.c b/lib/ext2fs/link.c
index a8e51506..978a6f3b 100644
--- a/lib/ext2fs/link.c
+++ b/lib/ext2fs/link.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <linux/ext2_fs.h>
diff --git a/lib/ext2fs/llseek.c b/lib/ext2fs/llseek.c
index 9829444c..5fd35596 100644
--- a/lib/ext2fs/llseek.c
+++ b/lib/ext2fs/llseek.c
@@ -16,7 +16,6 @@
#if HAVE_ERRNO_H
#include <errno.h>
#endif
-#include <stdlib.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
diff --git a/lib/ext2fs/lookup.c b/lib/ext2fs/lookup.c
index 364f2a2a..833ba4e5 100644
--- a/lib/ext2fs/lookup.c
+++ b/lib/ext2fs/lookup.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <linux/ext2_fs.h>
diff --git a/lib/ext2fs/mkdir.c b/lib/ext2fs/mkdir.c
index 9348cb7c..f517ba37 100644
--- a/lib/ext2fs/mkdir.c
+++ b/lib/ext2fs/mkdir.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#if HAVE_SYS_STAT_H
diff --git a/lib/ext2fs/namei.c b/lib/ext2fs/namei.c
index 576a99fb..f44c7df3 100644
--- a/lib/ext2fs/namei.c
+++ b/lib/ext2fs/namei.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
/* #define NAMEI_DEBUG */
diff --git a/lib/ext2fs/newdir.c b/lib/ext2fs/newdir.c
index 8e90a7a5..ed29a6f5 100644
--- a/lib/ext2fs/newdir.c
+++ b/lib/ext2fs/newdir.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <linux/ext2_fs.h>
diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c
index 26c7f7b2..7c0e2eb8 100644
--- a/lib/ext2fs/openfs.c
+++ b/lib/ext2fs/openfs.c
@@ -14,9 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#include <fcntl.h>
#include <time.h>
#if HAVE_SYS_STAT_H
diff --git a/lib/ext2fs/read_bb.c b/lib/ext2fs/read_bb.c
index 99c653d2..4e9a5ddb 100644
--- a/lib/ext2fs/read_bb.c
+++ b/lib/ext2fs/read_bb.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#if HAVE_SYS_STAT_H
diff --git a/lib/ext2fs/read_bb_file.c b/lib/ext2fs/read_bb_file.c
index 7534c640..6cdb1405 100644
--- a/lib/ext2fs/read_bb_file.c
+++ b/lib/ext2fs/read_bb_file.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#if HAVE_SYS_STAT_H
diff --git a/lib/ext2fs/rs_bitmap.c b/lib/ext2fs/rs_bitmap.c
index aee47259..73df276e 100644
--- a/lib/ext2fs/rs_bitmap.c
+++ b/lib/ext2fs/rs_bitmap.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#ifdef HAVE_SYS_STAT_H
diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c
index 7909fff7..93b775ce 100644
--- a/lib/ext2fs/rw_bitmaps.c
+++ b/lib/ext2fs/rw_bitmaps.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#ifdef HAVE_SYS_STAT_H
diff --git a/lib/ext2fs/swapfs.c b/lib/ext2fs/swapfs.c
index b4330d63..1a780f64 100644
--- a/lib/ext2fs/swapfs.c
+++ b/lib/ext2fs/swapfs.c
@@ -13,7 +13,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <time.h>
#include <linux/ext2_fs.h>
diff --git a/lib/ext2fs/test_io.c b/lib/ext2fs/test_io.c
index e2fe1ccc..1ac06634 100644
--- a/lib/ext2fs/test_io.c
+++ b/lib/ext2fs/test_io.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#if HAVE_SYS_STAT_H
diff --git a/lib/ext2fs/tst_badblocks.c b/lib/ext2fs/tst_badblocks.c
index 2063420e..0324dd7b 100644
--- a/lib/ext2fs/tst_badblocks.c
+++ b/lib/ext2fs/tst_badblocks.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#include <sys/stat.h>
diff --git a/lib/ext2fs/tst_getsize.c b/lib/ext2fs/tst_getsize.c
index 232fc2d1..49e8b6fd 100644
--- a/lib/ext2fs/tst_getsize.c
+++ b/lib/ext2fs/tst_getsize.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#include <sys/stat.h>
diff --git a/lib/ext2fs/tst_iscan.c b/lib/ext2fs/tst_iscan.c
index 2febe62e..9f5874b7 100644
--- a/lib/ext2fs/tst_iscan.c
+++ b/lib/ext2fs/tst_iscan.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#include <sys/stat.h>
diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c
index 53bedb9a..2c1d3c90 100644
--- a/lib/ext2fs/unix_io.c
+++ b/lib/ext2fs/unix_io.c
@@ -16,7 +16,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#if HAVE_SYS_STAT_H
@@ -195,7 +194,7 @@ static errcode_t unix_read_blk(io_channel channel, unsigned long block,
size = (count < 0) ? -count : count * channel->block_size;
location = (ext2_loff_t) block * channel->block_size;
if (ext2fs_llseek(data->dev, location, SEEK_SET) != location) {
- retval = errno ? errno : EXT2_IO_LLSEEK_FAILED;
+ retval = errno ? errno : EXT2_ET_LLSEEK_FAILED;
goto error_out;
}
actual = read(data->dev, buf, size);
@@ -244,7 +243,7 @@ static errcode_t unix_write_blk(io_channel channel, unsigned long block,
location = (ext2_loff_t) block * channel->block_size;
if (ext2fs_llseek(data->dev, location, SEEK_SET) != location) {
- retval = errno ? errno : EXT2_IO_LLSEEK_FAILED;
+ retval = errno ? errno : EXT2_ET_LLSEEK_FAILED;
goto error_out;
}
diff --git a/lib/ext2fs/unlink.c b/lib/ext2fs/unlink.c
index d880c471..bdaa7c18 100644
--- a/lib/ext2fs/unlink.c
+++ b/lib/ext2fs/unlink.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <linux/ext2_fs.h>
diff --git a/lib/ext2fs/valid_blk.c b/lib/ext2fs/valid_blk.c
index c7ca2b35..6d6734ee 100644
--- a/lib/ext2fs/valid_blk.c
+++ b/lib/ext2fs/valid_blk.c
@@ -14,7 +14,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <string.h>
#include <time.h>
diff --git a/lib/ext2fs/version.c b/lib/ext2fs/version.c
index 4e72f5c2..e3c49cd4 100644
--- a/lib/ext2fs/version.c
+++ b/lib/ext2fs/version.c
@@ -13,7 +13,6 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>