aboutsummaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-12-23 00:54:27 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2012-12-23 00:54:27 +0200
commit0077bc419d34a0341f978fc0e2d5cba8d35d4b28 (patch)
treef5cb831a306e99dce9a8c5af1b4be55cf7dbb658 /src/config.c
parent67a64a6a7809c183516740696e15ab88f82d7ef0 (diff)
downloadwydawca-0077bc419d34a0341f978fc0e2d5cba8d35d4b28.tar.gz
wydawca-0077bc419d34a0341f978fc0e2d5cba8d35d4b28.tar.bz2
Fix memory leaks, provide config statements for disabling inotify.
* src/config.c: New statement "inotify" (global and spool-specific). * src/gpg.c (gpg_verify_signature): Free key when no longer needed. (verify_directive_signature): Fix memory leak. * src/job.c (job_queue_runner): Free the unlinked job. * src/triplet.c (triplet_lookup): Free key.name. * src/verify.c (fill_project_name): Return immediately if trp->blurb is not null. * src/watcher.c (create_watcher): Ignore spool if its inotify_enable is false. (watcher_init): Return immediately if inotify_enable is false. * src/wydawca.c (inotify_enable): New global. * src/wydawca.h: Likewise.
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c
index 66d5fb7..509b0d5 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1158,6 +1158,10 @@ static struct grecs_keyword spool_kw[] = {
grecs_type_string, GRECS_DFLT,
NULL, offsetof(struct spool, file_sweep_time),
cb_interval },
+ { "inotify", NULL, N_("Enable or disable inotify for this spool"),
+ grecs_type_bool, GRECS_DFLT,
+ NULL, offsetof(struct spool, inotify_enable), },
+
{ "dictionary", N_("ident"), N_("Define data dictionary"),
grecs_type_section, GRECS_DFLT,
NULL, offsetof(struct spool, dictionary),
@@ -1200,6 +1204,7 @@ cb_spool (enum grecs_callback_command cmd,
spool = grecs_zalloc (sizeof (*spool));
spool->tag = grecs_strdup (value->v.string);
spool->file_sweep_time = file_sweep_time;
+ spool->inotify_enable = 1;
for (i = 0; i < NITEMS (spool->dictionary); i++)
spool->dictionary[i] = default_dictionary[i];
spool->archive = default_archive_descr;
@@ -1418,7 +1423,10 @@ static struct grecs_keyword wydawca_kw[] = {
grecs_type_string, GRECS_DFLT, &wakeup_interval, 0, cb_interval },
{ "pidfile", N_("file"), N_("Set pid file name"),
grecs_type_string, GRECS_DFLT, &pidfile },
-
+
+ { "inotify", NULL, N_("Enable or disable inotify support"),
+ grecs_type_bool, GRECS_DFLT, &inotify_enable },
+
{ "user", N_("name"), N_("Run with UID and GID of this user"),
grecs_type_string, GRECS_DFLT, NULL, 0, cb_user },
{ "group", NULL, N_("Retain these supplementary groups"),

Return to:

Send suggestions and report system problems to the System administrator.