Re: [PATCH 1/2] t/helper/test-chmtime: update mingw to support chmtime on directories
Jeff Hostetler <git@jeffhostetler.com> writes:
>> + HANDLE osfilehandle;
>
> I'd be more comfortable initializing this variable to
> INVALID_HANDLE_VALUE.
Both directories/files branches assign, so it is not needed.
>> + if (attrs & FILE_ATTRIBUTE_DIRECTORY) {
>> + fh = 0;
>
> and here initializing fh = -1.Show 6 quoted lines
> And then this becomes:
>
> if (fh != -1)
> close(fh)
> else if (osfilehandle != INVALID_HANDLE_VALUE)
> Closehandle(osfilehandle);