summaryrefslogtreecommitdiff
path: root/config/nsinstall.c
diff options
context:
space:
mode:
Diffstat (limited to 'config/nsinstall.c')
-rw-r--r--config/nsinstall.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/config/nsinstall.c b/config/nsinstall.c
index 0f3cd3e2..a5ef8dca 100644
--- a/config/nsinstall.c
+++ b/config/nsinstall.c
@@ -365,6 +365,11 @@ main(int argc, char **argv)
if (ftruncate(tofd, sb.st_size) < 0)
fail("cannot truncate %s", toname);
+ /*
+ ** On OpenVMS we can't chmod() until the file is closed, and we
+ ** have to utime() last since fchown/chmod alter the timestamps.
+ */
+#ifndef VMS
if (dotimes) {
utb.actime = sb.st_atime;
utb.modtime = sb.st_mtime;
@@ -377,6 +382,7 @@ main(int argc, char **argv)
if (chmod(toname, mode) < 0)
#endif
fail("cannot change mode of %s", toname);
+#endif
if ((owner || group) && fchown(tofd, uid, gid) < 0)
fail("cannot change owner of %s", toname);
@@ -384,6 +390,16 @@ main(int argc, char **argv)
if (close(tofd) < 0)
fail("cannot write to %s", toname);
close(fromfd);
+#ifdef VMS
+ if (chmod(toname, mode) < 0)
+ fail("cannot change mode of %s", toname);
+ if (dotimes) {
+ utb.actime = sb.st_atime;
+ utb.modtime = sb.st_mtime;
+ if (utime(toname, &utb) < 0)
+ fail("cannot set times of %s", toname);
+ }
+#endif
}
free(toname);