diff options
| author | Eli Zaretskii | 2012-10-04 22:07:45 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-10-04 22:07:45 +0200 |
| commit | 7604f29862ce57d9941ecc4813f9d9e2a09460c4 (patch) | |
| tree | d721e9c2cc0449b79fb7ba21fdf04e3e00989a3a | |
| parent | 0e2ae83d4be1b7c54546125baf9357bd423fc776 (diff) | |
| download | emacs-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/ChangeLog | 5 | ||||
| -rw-r--r-- | src/w32.c | 2 |
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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-10-04 Paul Eggert <eggert@cs.ucla.edu> | 6 | 2012-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, |
| @@ -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); |