aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2016-08-13 08:51:17 +0300
committerSergey Poznyakoff <gray@gnu.org>2016-08-13 08:51:17 +0300
commitb65ef6179a6d84f8a6290a8268acc8e675b32d95 (patch)
tree4e495727d7d9ac3c492292d63e54bc79f4bf2e47
parentde0a2f0f8abdac9596db9c44c788b3acdcac39f4 (diff)
downloaddirevent-b65ef6179a6d84f8a6290a8268acc8e675b32d95.tar.gz
direvent-b65ef6179a6d84f8a6290a8268acc8e675b32d95.tar.bz2
Fix comments
-rw-r--r--src/watcher.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/watcher.c b/src/watcher.c
index 7275640..dc07643 100644
--- a/src/watcher.c
+++ b/src/watcher.c
@@ -210,16 +210,18 @@ deliver_ev_create(struct dirwatcher *dp, const char *name)
run_handler(h, &m, dp->dirname, name);
}
}
/* Check if a new watcher must be created and create it if so.
- A watcher must be created if its parent's autowatch has a non-null
- value. If it has a negative value, it will be inherited by the new
- watcher. Otherwise, the new watcher will inherit the parent's autowatch
- decreased by one.
+ A watcher must be created if its parent's recursion depth has a non-null
+ value. If it has a negative value, which means "recursively watch new
+ subdirectories without limit on their nesting level", it will be inherited
+ by the new watcher. Otherwise, the new watcher will inherit the parent's
+ depth decreased by one, thus eventually cutting off creation of new
+ watchers.
Return 0 on success, -1 on error.
*/
int
check_new_watcher(const char *dir, const char *name)
{
@@ -264,13 +266,13 @@ dirwatcher_pattern_match(struct dirwatcher *dwp, const char *file_name)
return 0;
}
return 1;
}
/* Recursively scan subdirectories of parent and add them to the
- watcher list, as requested by the parent's autowatch value. */
+ watcher list, as requested by the parent's recursion depth value. */
static int
watch_subdirs(struct dirwatcher *parent, int notify)
{
DIR *dir;
struct dirent *ent;
int filemask = sysev_filemask(parent);
@@ -296,13 +298,14 @@ watch_subdirs(struct dirwatcher *parent, int notify)
(ent->d_name[1] == 0 ||
(ent->d_name[1] == '.' && ent->d_name[2] == 0)))
continue;
dirname = mkfilename(parent->dirname, ent->d_name);
if (!dirname) {
- diag(LOG_ERR, _("cannot stat %s/%s: not enough memory"),
+ diag(LOG_ERR,
+ _("cannot stat %s/%s: not enough memory"),
parent->dirname, ent->d_name);
continue;
}
if (stat(dirname, &st)) {
diag(LOG_ERR, _("cannot stat %s: %s"),
dirname, strerror(errno));

Return to:

Send suggestions and report system problems to the System administrator.