Module: wine Branch: master Commit: 639e07bead189626dc2b1e02fb30cd74d39c01bd URL: http://source.winehq.org/git/wine.git/?a=commit;h=639e07bead189626dc2b1e02fb...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Oct 22 19:59:04 2009 +0200
ntdll: Abstract the support for comparing file identities.
---
dlls/ntdll/directory.c | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index ce9e81d..2e0aba0 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -139,11 +139,13 @@ static inline int getdents64( int fd, char *de, unsigned int size )
#define MAX_IGNORED_FILES 4
-static struct +struct file_identity { dev_t dev; ino_t ino; -} ignored_files[MAX_IGNORED_FILES]; +}; + +static struct file_identity ignored_files[MAX_IGNORED_FILES]; static int ignored_files_count;
static const unsigned int max_dir_info_size = FIELD_OFFSET( FILE_BOTH_DIR_INFORMATION, FileName[MAX_DIR_ENTRY_LEN] ); @@ -197,13 +199,17 @@ static inline void ignore_file( const char *name ) } }
+static inline BOOL is_same_file( const struct file_identity *file, const struct stat *st ) +{ + return st->st_dev == file->dev && st->st_ino == file->ino; +} + static inline BOOL is_ignored_file( const struct stat *st ) { unsigned int i;
for (i = 0; i < ignored_files_count; i++) - if (ignored_files[i].dev == st->st_dev && ignored_files[i].ino == st->st_ino) - return TRUE; + if (is_same_file( &ignored_files[i], st )) return TRUE; return FALSE; }