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.
diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog
index e54ef4e..bbe2478 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 123860c..6e7b553 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 769aec9..8c42cd7 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 ab1404d..fba2d99 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 4b52675..ec4911e 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 abad675..eab5a78 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 0887e57..e50560c 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 2946003..c594d8d 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 43f9f31..ec421ce 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 6972257..0a5a80c 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 3f82a29..c515e4a 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 602753d..0764ae4 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 4a880e8..b39b15d 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 9cec4d7..422606b 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 cdf1bef..4c15922 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 @@
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 2c8b8a1..1594cdc 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 0784ef2..725cd47 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 0bb7cc5..85a38de 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 b1d7971..c6baddb 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 f358eca..667726d 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 fc14ad4..07973a4 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 f9eb34e..f19fdbe 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 4f34fde..f0e55e1 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 71d1ef7..52a769e 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 baa9af8..9ace71a 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 c90708e..a8cd59c 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 56e5013..72ef44d 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 1fcff19..4ab44de 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 97c3d06..fc09668 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 8695ff0..d72e00c 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 6ff816b..2ca6fb5 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 621fd18..0761ec8 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 a8e5150..978a6f3 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 9829444..5fd3559 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 364f2a2..833ba4e 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 9348cb7..f517ba3 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 576a99f..f44c7df 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 8e90a7a..ed29a6f 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 26c7f7b..7c0e2eb 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 99c653d..4e9a5dd 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 7534c64..6cdb140 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 aee4725..73df276 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 7909fff..93b775c 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 b4330d6..1a780f6 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 e2fe1cc..1ac0663 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 2063420..0324dd7 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 232fc2d..49e8b6f 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 2febe62..9f5874b 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 53bedb9..2c1d3c9 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 @@
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 @@
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 d880c47..bdaa7c1 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 c7ca2b3..6d6734e 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 4e72f5c..e3c49cd 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>