From 5afd4421ce1b323a8e98eeb22f6d6d7afdea0a4b Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Thu, 3 Oct 2013 21:45:48 +0200 Subject: [PATCH] Doesn't use inodes in dirent in Windows. --- mingw.c | 1 - mingw.h | 2 +- scan.c | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/mingw.c b/mingw.c index 5f21ce5f..71f3d51b 100644 --- a/mingw.c +++ b/mingw.c @@ -548,7 +548,6 @@ static void windows_finddata2dirent(const WIN32_FIND_DATAW* info, struct windows exit(EXIT_FAILURE); } - dirent->d_ino = 0; memcpy(dirent->d_name, name, len + 1); /* Store the HIDDEN attribute in a separate field */ diff --git a/mingw.h b/mingw.h index 52d6f39b..0bc79246 100644 --- a/mingw.h +++ b/mingw.h @@ -72,6 +72,7 @@ #define O_NOFOLLOW 0 #define dirent_hidden windows_dirent_hidden #define HAVE_STRUCT_DIRENT_D_STAT 1 +#undef HAVE_STRUCT_DIRENT_D_INO #define dirent_lstat windows_dirent_lstat #define stat_desc windows_stat_desc #undef sleep @@ -226,7 +227,6 @@ int windows_open(const char* file, int flags, ...); struct windows_dirent { char d_name[PATH_MAX]; int d_hidden; - uint64_t d_ino; /**< Not significative. Always 0. */ WIN32_FIND_DATAW d_data; }; diff --git a/scan.c b/scan.c index db1ef0a1..391e7ad4 100644 --- a/scan.c +++ b/scan.c @@ -685,7 +685,7 @@ struct dirent_sorted { char d_name[1]; /**< Variable length name. It must be the last field. */ }; -#ifndef _WIN32 /* In Windows doesn't sort */ +#if HAVE_STRUCT_DIRENT_D_INO static int dd_ino_compare(const void* void_a, const void* void_b) { const struct dirent_sorted* a = void_a; @@ -817,7 +817,7 @@ static int scan_dir(struct snapraid_scan* scan, struct snapraid_state* state, in exit(EXIT_FAILURE); } -#ifndef _WIN32 /* In Windows doesn't sort. The inode is not significative */ +#if HAVE_STRUCT_DIRENT_D_INO /* if inodes are persistent */ if (!disk->has_not_persistent_inodes) { /* sort the list of dir entries by inodes */