summaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2011-02-13 20:30:03 +0200
committerArnold D. Robbins <arnold@skeeve.com>2011-02-13 20:30:03 +0200
commit32086b1f52a9978db1e8168b56a312e76afcf5ab (patch)
treede490c1c7d47bcbc6428d622957240679483d6b6 /posix
parent6bfbae33e99c401f89a4d650ea7958bbdebd362e (diff)
downloadgawk-32086b1f52a9978db1e8168b56a312e76afcf5ab.tar.gz
PC fixes for portability and dependencies.
Diffstat (limited to 'posix')
-rw-r--r--posix/ChangeLog5
-rw-r--r--posix/gawkmisc.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/posix/ChangeLog b/posix/ChangeLog
index 7df9b9e6..e0cce059 100644
--- a/posix/ChangeLog
+++ b/posix/ChangeLog
@@ -1,3 +1,8 @@
+Sun Feb 13 20:23:34 2011 Eli Zaretskii <eliz@gnu.org>
+
+ * gawkmisc.c (files_are_same): Change arguments; call `stat' as
+ part of the body.
+
Tue Feb 1 23:05:51 2011 Corinna Vinschen <vinschen@redhat.com>
Make values of ctype macros into unsigned char to fix
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__