Commit 7604f298 authored by Eli Zaretskii's avatar Eli Zaretskii

Fix test for invalid handle in w32.c's 'utime'.

 src/w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
 see whether CreateFile failed.
parent 0e2ae83d
2012-10-04 Eli Zaretskii <eliz@gnu.org>
* w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
see whether CreateFile failed.
2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
* profiler.c (handle_profiler_signal): Inhibit pending signals too,
......
......@@ -3954,7 +3954,7 @@ utime (const char *name, struct utimbuf *times)
/* Need write access to set times. */
fh = CreateFile (name, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
0, OPEN_EXISTING, 0, NULL);
if (fh)
if (fh != INVALID_HANDLE_VALUE)
{
convert_from_time_t (times->actime, &atime);
convert_from_time_t (times->modtime, &mtime);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment