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