forked from 0ad/0ad
fix dir_cancel_watch issue: fail silently if watch=0 (happens if directory mounted only from archive, i.e. there's no real directory to watch)
This was SVN commit r1524.
This commit is contained in:
parent
323ca1746f
commit
5bb24a387f
@ -419,7 +419,7 @@ struct TDir
|
|||||||
TDir()
|
TDir()
|
||||||
{
|
{
|
||||||
#ifndef NO_DIR_WATCH
|
#ifndef NO_DIR_WATCH
|
||||||
watch = -1;
|
watch = 0; // not yet initialized
|
||||||
#endif
|
#endif
|
||||||
loc = 0;
|
loc = 0;
|
||||||
exact_dir_name = 0; // safety
|
exact_dir_name = 0; // safety
|
||||||
|
@ -247,7 +247,7 @@ fail:
|
|||||||
|
|
||||||
int dir_cancel_watch(const intptr_t reqnum)
|
int dir_cancel_watch(const intptr_t reqnum)
|
||||||
{
|
{
|
||||||
if(reqnum < 0)
|
if(reqnum <= 0)
|
||||||
return ERR_INVALID_PARAM;
|
return ERR_INVALID_PARAM;
|
||||||
|
|
||||||
Watch* w = watches[reqnum];
|
Watch* w = watches[reqnum];
|
||||||
|
Loading…
Reference in New Issue
Block a user