diff --git a/include/share/grabbag/file.h b/include/share/grabbag/file.h index ed755ec8..e5918ee2 100644 --- a/include/share/grabbag/file.h +++ b/include/share/grabbag/file.h @@ -45,7 +45,8 @@ const char *grabbag__file_get_basename(const char *srcpath); */ FLAC__bool grabbag__file_change_stats(const char *filename, FLAC__bool read_only); -/* returns true iff stat() succeeds for both files and they have the same inode */ +/* returns true iff stat() succeeds for both files and they have the same device and inode */ +/*@@@ this does not work on windows so for that the function just returns !strcmp(f1,f2) */ FLAC__bool grabbag__file_are_same(const char *f1, const char *f2); /* attempts to make writable before unlinking */ diff --git a/src/share/grabbag/file.c b/src/share/grabbag/file.c index f0fae6db..9c157888 100644 --- a/src/share/grabbag/file.c +++ b/src/share/grabbag/file.c @@ -114,7 +114,7 @@ FLAC__bool grabbag__file_are_same(const char *f1, const char *f2) return f1 && f2 && 0 == strcmp(f1, f2); /*@@@@@@ need better method than strcmp */ #else struct stat s1, s2; - return f1 && f2 && stat(f1, &s1) == 0 && stat(f2, &s2) == 0 && s1.st_ino == s2.st_ino; + return f1 && f2 && stat(f1, &s1) == 0 && stat(f2, &s2) == 0 && s1.st_ino == s2.st_ino && s1.st_dev == s2.st_dev; #endif }