summaryrefslogtreecommitdiff
path: root/test-chmtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'test-chmtime.c')
-rw-r--r--test-chmtime.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/test-chmtime.c b/test-chmtime.c
index d5358cbaac..fe476cb618 100644
--- a/test-chmtime.c
+++ b/test-chmtime.c
@@ -87,6 +87,15 @@ int main(int argc, const char *argv[])
return -1;
}
+#ifdef WIN32
+ if (!(sb.st_mode & S_IWUSR) &&
+ chmod(argv[i], sb.st_mode | S_IWUSR)) {
+ fprintf(stderr, "Could not make user-writable %s: %s",
+ argv[i], strerror(errno));
+ return -1;
+ }
+#endif
+
utb.actime = sb.st_atime;
utb.modtime = set_eq ? set_time : sb.st_mtime + set_time;