diff options
Diffstat (limited to 'posix/gawkmisc.c')
-rw-r--r-- | posix/gawkmisc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/posix/gawkmisc.c b/posix/gawkmisc.c index 2e70cf9c..0b3aa6d5 100644 --- a/posix/gawkmisc.c +++ b/posix/gawkmisc.c @@ -237,9 +237,13 @@ os_restore_mode(int fd) /* files_are_same --- return true if files are identical */ int -files_are_same(struct stat *f1, struct stat *f2) +files_are_same(char *path, SRCFILE *src) { - return (f1->st_dev == f2->st_dev && f1->st_ino == f2->st_ino); + struct stat st; + + return (stat(path, & st) == 0 + && st.st_dev == src->sbuf.st_dev + && st.st_ino == src->sbuf.st_ino); } #ifdef __CYGWIN__ |