diff options
| author | Eli Zaretskii | 2012-10-07 17:54:07 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-10-07 17:54:07 +0200 |
| commit | 7d6053541271df526e551ab02b210ce07c7b7ce7 (patch) | |
| tree | f182b114ae6701176e885c22fe5c4f67a22c112c /src | |
| parent | c5c91b847a41ec7e09dee582816d702c8a9adcdd (diff) | |
| download | emacs-7d6053541271df526e551ab02b210ce07c7b7ce7.tar.gz emacs-7d6053541271df526e551ab02b210ce07c7b7ce7.zip | |
Zero out dirwatch->dir when bailing out for any reason.
Signal an error if a watch is requested while another one is active.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32notify.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/w32notify.c b/src/w32notify.c index 81199b2a0a1..c5cfa3dba44 100644 --- a/src/w32notify.c +++ b/src/w32notify.c | |||
| @@ -203,6 +203,7 @@ watch_completion (DWORD status, DWORD bytes_ret, OVERLAPPED *io_info) | |||
| 203 | dirwatch->io_info = NULL; | 203 | dirwatch->io_info = NULL; |
| 204 | xfree (dirwatch->watchee); | 204 | xfree (dirwatch->watchee); |
| 205 | dirwatch->watchee = NULL; | 205 | dirwatch->watchee = NULL; |
| 206 | dirwatch->dir = NULL; | ||
| 206 | dirwatch->terminate = 1; | 207 | dirwatch->terminate = 1; |
| 207 | } | 208 | } |
| 208 | else | 209 | else |
| @@ -285,6 +286,7 @@ start_watching (const char *file, HANDLE hdir, BOOL subdirs, DWORD flags) | |||
| 285 | dirwatch.io_info = NULL; | 286 | dirwatch.io_info = NULL; |
| 286 | xfree (dirwatch.watchee); | 287 | xfree (dirwatch.watchee); |
| 287 | dirwatch.watchee = NULL; | 288 | dirwatch.watchee = NULL; |
| 289 | dirwatch.dir = NULL; | ||
| 288 | return -1; | 290 | return -1; |
| 289 | } | 291 | } |
| 290 | return 0; | 292 | return 0; |
| @@ -471,6 +473,9 @@ FILE is the name of the file whose event is being reported. */) | |||
| 471 | Qnil); | 473 | Qnil); |
| 472 | } | 474 | } |
| 473 | 475 | ||
| 476 | if (dirwatch.dir) | ||
| 477 | error ("File watch already active"); | ||
| 478 | |||
| 474 | /* We needa full absolute file name of FILE, and we need to remove | 479 | /* We needa full absolute file name of FILE, and we need to remove |
| 475 | any trailing slashes from it, so that GetFullPathName below gets | 480 | any trailing slashes from it, so that GetFullPathName below gets |
| 476 | the basename part correctly. */ | 481 | the basename part correctly. */ |