X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=test-chmtime.c;h=fe476cb6185a389671c014b4ea067184f51465d0;hb=511a3fc116799df5e3b2262f8f6e501ca73ba2fe;hp=d5358cbaac2022483b74366555fc9707a7d8ad97;hpb=718258e256b74622aa55f5ee0cb9cff4cce6bf9f;p=git.git diff --git a/test-chmtime.c b/test-chmtime.c index d5358cbaa..fe476cb61 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;