]> granicus.if.org Git - neomutt/commitdiff
remove check for <dirent.h> d_ino
authorRichard Russon <rich@flatcap.org>
Mon, 1 May 2017 04:38:15 +0000 (05:38 +0100)
committerRichard Russon <rich@flatcap.org>
Tue, 2 May 2017 16:34:43 +0000 (17:34 +0100)
posix:2001 declares 'd_ino' in <dirent.h>

configure.ac
mh.c

index f18ebd1b42596d59250bbc9ad3da8fe68451dd6b..8eb79d2fcda91ffbad5064bad3f05fccc07e8f39 100644 (file)
@@ -834,15 +834,6 @@ if test $mutt_cv_fcntl = yes; then
        AC_DEFINE(USE_FCNTL,1, [ Define to use fcntl() to lock folders. ])
 fi
 
-AC_MSG_CHECKING(whether struct dirent defines d_ino)
-ac_cv_dirent_d_ino=no
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <dirent.h>]], [[struct dirent dp; (void)dp.d_ino]])],[ac_cv_dirent_d_ino=yes],[])
-if test x$ac_cv_dirent_d_ino = xyes; then
-       AC_DEFINE(HAVE_DIRENT_D_INO,1,
-               [Define to 1 if your system has the dirent::d_ino member])
-fi
-AC_MSG_RESULT($ac_cv_dirent_d_ino)
-
 mutt_cv_warnings=yes
 AC_ARG_ENABLE(warnings, AS_HELP_STRING([--disable-warnings],[Turn off compiler warnings (not recommended)]),
        [if test $enableval = no; then
diff --git a/mh.c b/mh.c
index 6f305a0ef5dfd42ac7cea03cf90a0c1072ca1f83..25e6aaf6ba545f9ab2dc9883287a99fcb6607d8e 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -62,9 +62,7 @@ struct maildir
   HEADER *h;
   char *canon_fname;
   unsigned header_parsed : 1;
-#ifdef HAVE_DIRENT_D_INO
   ino_t inode;
-#endif /* HAVE_DIRENT_D_INO */
   struct maildir *next;
 };
 
@@ -840,9 +838,7 @@ static int maildir_parse_dir(CONTEXT *ctx, struct maildir ***last,
 
     entry = safe_calloc(sizeof(struct maildir), 1);
     entry->h = h;
-#ifdef HAVE_DIRENT_D_INO
     entry->inode = de->d_ino;
-#endif /* HAVE_DIRENT_D_INO */
     **last = entry;
     *last = &entry->next;
   }
@@ -911,12 +907,10 @@ static size_t maildir_hcache_keylen(const char *fn)
 }
 #endif
 
-#ifdef HAVE_DIRENT_D_INO
 static int md_cmp_inode(struct maildir *a, struct maildir *b)
 {
   return a->inode - b->inode;
 }
-#endif
 
 static int md_cmp_path(struct maildir *a, struct maildir *b)
 {
@@ -1056,7 +1050,6 @@ static void mh_sort_natural(CONTEXT *ctx, struct maildir **md)
   *md = maildir_sort(*md, (size_t) -1, md_cmp_path);
 }
 
-#ifdef HAVE_DIRENT_D_INO
 static struct maildir *skip_duplicates(struct maildir *p, struct maildir **last)
 {
   /*
@@ -1076,7 +1069,6 @@ static struct maildir *skip_duplicates(struct maildir *p, struct maildir **last)
   }
   return p;
 }
-#endif
 
 /*
  * This function does the second parsing pass
@@ -1086,9 +1078,7 @@ static void maildir_delayed_parsing(CONTEXT *ctx, struct maildir **md, progress_
   struct maildir *p, *last = NULL;
   char fn[_POSIX_PATH_MAX];
   int count;
-#ifdef HAVE_DIRENT_D_INO
   int sort = 0;
-#endif
 #ifdef USE_HCACHE
   header_cache_t *hc = NULL;
   void *data = NULL;
@@ -1099,7 +1089,6 @@ static void maildir_delayed_parsing(CONTEXT *ctx, struct maildir **md, progress_
   int ret;
 #endif
 
-#ifdef HAVE_DIRENT_D_INO
 #define DO_SORT()                                                              \
   do                                                                           \
   {                                                                            \
@@ -1116,9 +1105,6 @@ static void maildir_delayed_parsing(CONTEXT *ctx, struct maildir **md, progress_
       snprintf(fn, sizeof(fn), "%s/%s", ctx->path, p->h->path);                \
     }                                                                          \
   } while (0)
-#else
-#define DO_SORT() /* nothing */
-#endif
 
 #ifdef USE_HCACHE
   hc = mutt_hcache_open(HeaderCache, ctx->path, NULL);