X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=test-chmtime.c;h=fe476cb6185a389671c014b4ea067184f51465d0;hb=6821dee9a91131e1a003ee65b2f4218a19ea8f3d;hp=d5358cbaac2022483b74366555fc9707a7d8ad97;hpb=268c015495038be387ad3c5d674851889c497716;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;