aboutsummaryrefslogtreecommitdiffstats
path: root/vms/gawkmisc.vms
diff options
context:
space:
mode:
Diffstat (limited to 'vms/gawkmisc.vms')
-rw-r--r--vms/gawkmisc.vms23
1 files changed, 14 insertions, 9 deletions
diff --git a/vms/gawkmisc.vms b/vms/gawkmisc.vms
index 316e613d..afff3b8c 100644
--- a/vms/gawkmisc.vms
+++ b/vms/gawkmisc.vms
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-1996, 2003 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-1996, 2003, 2011 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -173,13 +173,18 @@ int fd;
/* files_are_same --- deal with VMS struct stat */
int
-files_are_same(struct stat *f1, struct stat *f2)
+files_are_same(char *newfile, SRCFILE *oldfile)
{
- struct stat st;
-
- return (stat(path, & st) == 0
- && strcmp(f1->st_dev, f2->st_dev) == 0
- && f1->st_ino[0] == f2->st_ino[0]
- && f1->st_ino[1] == f2->st_ino[1]
- && f1->st_ino[2] == f2->st_ino[2]);
+ struct stat st, *f1, *f2;
+
+ f1 = &st;
+ if (stat(newfile, f1) != 0) return 0;
+
+ f2 = &oldfile->sbuf;
+ /* compare device string */
+ return (strcmp(f1->st_dev, f2->st_dev) == 0
+ /* and 48-bit file id cookie stored in 3 short ints */
+ && f1->st_ino[0] == f2->st_ino[0]
+ && f1->st_ino[1] == f2->st_ino[1]
+ && f1->st_ino[2] == f2->st_ino[2]);
}