mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-15 23:16:18 +00:00
re-enable warning when ReadDirectoryChanges fails (underlying problem solved)
This was SVN commit r976.
This commit is contained in:
@@ -214,6 +214,7 @@ int dir_add_watch(const char* const dir, intptr_t* const _reqnum)
|
||||
try
|
||||
{
|
||||
Watch* w = new Watch(reqnum, dir_s, hDir);
|
||||
assert(w != 0); // happened once; heap corruption?
|
||||
|
||||
// add trailing \ if not already there
|
||||
if(dir_s[dir_s.length()-1] != '\\')
|
||||
@@ -224,6 +225,7 @@ int dir_add_watch(const char* const dir, intptr_t* const _reqnum)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
// post a dummy kickoff packet; the IOCP polling code will "re"issue
|
||||
// the corresponding watch. this keeps the ReadDirectoryChangesW call
|
||||
// and directory <--> Watch association code in one place.
|
||||
@@ -245,7 +247,15 @@ fail:
|
||||
|
||||
int dir_cancel_watch(const intptr_t reqnum)
|
||||
{
|
||||
if(reqnum < 0)
|
||||
return -1;
|
||||
|
||||
Watch* w = watches[reqnum];
|
||||
if(!w)
|
||||
{
|
||||
debug_warn("dir_cancel_watch: watches[reqnum] invalid");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// contrary to dox, the RDC IOs do not issue a completion notification.
|
||||
// no packet was received on the IOCP while or after cancelling in a test.
|
||||
|
||||
Reference in New Issue
Block a user