diff options
author | Tomáš Chvátal <tomas.chvatal@gmail.com> | 2014-11-29 10:48:59 +0100 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2014-12-02 14:26:19 +0100 |
commit | cf72fc686c672f4f678ffe27e616b69b75bd1354 (patch) | |
tree | 30ff01a2f283c40c9032f3072c705c655a4b6e3a | |
parent | 7d82c859fcc81efebf5ac6c2ebc0ded0888c2a19 (diff) |
Use just one define to determine if using ext2direct
Signed-off-by: Tomáš Chvátal <tchvatal@suse.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | quotacheck.c | 12 |
2 files changed, 4 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac index a93cd9d..5a38424 100644 --- a/configure.ac +++ b/configure.ac @@ -111,8 +111,6 @@ AS_IF([test "x$enable_ext2direct" != "xno"], [ ]) ]) AS_IF([test "x$build_ext2direct" != "xno"], [ - AC_DEFINE([HAVE_EXT2_INO_T], 1, [ext2fs.h defines ext2_ino_t]) - AC_DEFINE([HAVE_EXT2_INCLUDE], 1, [Header files for e2fslib]) AC_DEFINE([EXT2_DIRECT], 1, [Scanning of ext? filesystems using e2fslib]) COMPILE_OPTS="$COMPILE_OPTS EXT2_DIRECT" ]) diff --git a/quotacheck.c b/quotacheck.c index 3cf87e0..6f34cff 100644 --- a/quotacheck.c +++ b/quotacheck.c @@ -28,7 +28,7 @@ #include <sys/mount.h> #include <sys/utsname.h> -#if defined(HAVE_EXT2_INCLUDE) +#ifdef EXT2_DIRECT #include <linux/types.h> #include <ext2fs/ext2fs.h> #endif @@ -42,10 +42,6 @@ #include "quotacheck.h" #include "quotaops.h" -#ifndef HAVE_EXT2_INO_T -typedef ino_t ext2_ino_t; -#endif - #define LINKSHASHSIZE 16384 /* Size of hashtable for hardlinked inodes */ #define DQUOTHASHSIZE 32768 /* Size of hashtable for dquots from file */ @@ -680,7 +676,7 @@ static int rename_files(struct mount_entry *mnt, int type) char *filename, newfilename[PATH_MAX]; struct stat st; mode_t mode = S_IRUSR | S_IWUSR; -#ifdef HAVE_EXT2_INCLUDE +#ifdef EXT2_DIRECT long ext2_flags = -1; int fd; #endif @@ -702,7 +698,7 @@ static int rename_files(struct mount_entry *mnt, int type) return -1; } mode = st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); -#ifdef HAVE_EXT2_INCLUDE +#ifdef EXT2_DIRECT if ((fd = open(filename, O_RDONLY)) < 0) { if (errno == ENOENT) { debug(FL_DEBUG | FL_VERBOSE, _("Old file found removed during check!\n")); @@ -760,7 +756,7 @@ rename_new: free(filename); return -1; } -#ifdef HAVE_EXT2_INCLUDE +#ifdef EXT2_DIRECT if (ext2_flags != -1) { if ((fd = open(filename, O_RDONLY)) < 0) { errstr(_("Cannot open new quota file %s: %s\n"), filename, strerror(errno)); |