undelfs simplifications.

m4.include/vfs/mc-vfs-undelfs.m4: simplify test of required libraries.
Don't test Linux kernel specific header.

src/vfs/undelfs/undelfs.c: don't include Linux kernel specific header.
Use headers from ext2fs library only.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2021-01-24 20:15:12 +03:00
parent 5a4d1dd122
commit f5b813a0ab
2 changed files with 14 additions and 42 deletions

View File

@ -5,41 +5,21 @@ dnl "no" otherwise. May define ENABLE_VFS_UNDELFS for cpp.
dnl Will set EXT2FS_UNDEL_LIBS to required libraries.
AC_DEFUN([mc_UNDELFS_CHECKS], [
ext2fs_undel=no
EXT2FS_UNDEL_LIBS=
AC_CHECK_HEADERS([ext2fs/ext2_fs.h linux/ext2_fs.h], [ext2_fs_h=yes; break])
if test x"$ext2_fs_h" = xyes; then
AC_CHECK_HEADERS([ext2fs/ext2fs.h], [ext2fs_ext2fs_h=yes], ,
[
#include <stdio.h>
#ifdef HAVE_EXT2FS_EXT2_FS_H
#include <ext2fs/ext2_fs.h>
#else
#undef umode_t
#include <linux/ext2_fs.h>
#endif
])
if test x"$ext2fs_ext2fs_h" = xyes; then
ext2fs_undel=yes
EXT2FS_UNDEL_LIBS="-lext2fs -lcom_err"
AC_CHECK_TYPE([ext2_ino_t], ,
[AC_DEFINE_UNQUOTED([ext2_ino_t], [ino_t],
[Define to ino_t if undefined.])],
[
#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#ifdef HAVE_EXT2FS_EXT2_FS_H
#include <ext2fs/ext2_fs.h>
#else
#undef umode_t
#include <linux/ext2_fs.h>
#endif
#include <ext2fs/ext2fs.h>
])
ext2fs_undel=no
EXT2FS_UNDEL_LIBS=
dnl Use result of mc_EXT2FS_ATTR that was called earlier
if test "x$ext2fs_attr_msg" = "xyes"; then
com_err=no
PKG_CHECK_MODULES(COM_ERR, [com_err >= 1.42.4], [com_err=yes], [:])
if test x"$com_err" = "xyes"; then
EXT2FS_UNDEL_LIBS="$EXT2FS_LIBS $COM_ERR_LIBS"
ext2fs_undel=yes
fi
fi
fi
])
dnl

View File

@ -49,15 +49,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h> /* memset() */
#ifdef HAVE_EXT2FS_EXT2_FS_H
#include <ext2fs/ext2_fs.h>
#else
/* asm/types.h defines its own umode_t */
#undef umode_t
#include <linux/ext2_fs.h>
#endif
#include <ext2fs/ext2fs.h>
#include <ctype.h>