aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2012-10-04 22:07:45 +0200
committerEli Zaretskii2012-10-04 22:07:45 +0200
commit7604f29862ce57d9941ecc4813f9d9e2a09460c4 (patch)
treed721e9c2cc0449b79fb7ba21fdf04e3e00989a3a
parent0e2ae83d4be1b7c54546125baf9357bd423fc776 (diff)
downloademacs-7604f29862ce57d9941ecc4813f9d9e2a09460c4.tar.gz
emacs-7604f29862ce57d9941ecc4813f9d9e2a09460c4.zip
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.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/w32.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9790ff7d0d1..85a4c829063 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12012-10-04 Eli Zaretskii <eliz@gnu.org>
2
3 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
4 see whether CreateFile failed.
5
12012-10-04 Paul Eggert <eggert@cs.ucla.edu> 62012-10-04 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 * profiler.c (handle_profiler_signal): Inhibit pending signals too, 8 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
diff --git a/src/w32.c b/src/w32.c
index 3d3ae7eebc3..6b52fb8398d 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -3954,7 +3954,7 @@ utime (const char *name, struct utimbuf *times)
3954 /* Need write access to set times. */ 3954 /* Need write access to set times. */
3955 fh = CreateFile (name, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 3955 fh = CreateFile (name, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
3956 0, OPEN_EXISTING, 0, NULL); 3956 0, OPEN_EXISTING, 0, NULL);
3957 if (fh) 3957 if (fh != INVALID_HANDLE_VALUE)
3958 { 3958 {
3959 convert_from_time_t (times->actime, &atime); 3959 convert_from_time_t (times->actime, &atime);
3960 convert_from_time_t (times->modtime, &mtime); 3960 convert_from_time_t (times->modtime, &mtime);