aboutsummaryrefslogtreecommitdiff
path: root/src/watcher.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/watcher.c')
-rw-r--r--src/watcher.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/watcher.c b/src/watcher.c
index f8761ee..c52e3e6 100644
--- a/src/watcher.c
+++ b/src/watcher.c
@@ -80,15 +80,22 @@ create_watcher (struct spool *sp, void *data)
struct dirwatcher *dwp;
int wd;
const char *path = get_path (sp);
if (!sp)
return 0;
+
+ if (!sp->inotify_enable)
+ {
+ if (debug_level > 1)
+ logmsg (LOG_DEBUG, "disabling inotify support for spool %s", sp->tag);
+ return 0;
+ }
if (debug_level > 1)
- logmsg (LOG_DEBUG, "creating watcher %s", path);
+ logmsg (LOG_DEBUG, "spool %s: creating watcher %s", sp->tag, path);
dwp = malloc (sizeof(*dwp));
if (!dwp)
{
logmsg (LOG_ERR, "not enough memory");
return 1;
}
@@ -110,12 +117,19 @@ create_watcher (struct spool *sp, void *data)
}
int
watcher_init ()
{
int ifd, rc;
+
+ if (!inotify_enable)
+ {
+ if (debug_level > 1)
+ logmsg (LOG_DEBUG, "disabling inotify support");
+ return -1;
+ }
if (debug_level > 1)
logmsg (LOG_DEBUG, "setting up inotify");
ifd = inotify_init ();
if (ifd == -1)
{

Return to:

Send suggestions and report system problems to the System administrator.