diff options
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/config.c b/src/config.c index a7ceb92..ee9f0c3 100644 --- a/src/config.c +++ b/src/config.c @@ -125,7 +125,7 @@ static struct archive_descr default_archive_descr = { }; static struct dictionary *default_dictionary[dictionary_count]; -struct notification *default_notification = NULL; +NOTIFYQ default_notification = NOTIFYQ_INITIALIZER(default_notification); /* safe_file_name: convert a file name possibly containig relative specs (../) into a safer form using only direct descendence. @@ -879,9 +879,7 @@ cb_notify_event(enum grecs_callback_command cmd, grecs_node_t * node, else { /* FIXME: Check if the module is defined. Better yet, delay this check until config_finish */ - struct notification **p = (struct notification **) varptr; - ntf->next = *p; - *p = ntf; + NOTIFYQ_APPEND((NOTIFYQ*)varptr, ntf); /* FIXME: check ev and tgt? */ } break; @@ -1135,7 +1133,7 @@ static struct grecs_keyword spool_kw[] = { { "notify-event", NULL, N_("Configure notification"), grecs_type_section, GRECS_MULT, - NULL, offsetof(struct spool, notification), + NULL, offsetof(struct spool, notification_queue), cb_notify_event, NULL, notify_event_kw }, { "check-script", NULL, N_("A /bin/sh script to verify the tarball"), @@ -1207,14 +1205,16 @@ cb_spool(enum grecs_callback_command cmd, grecs_node_t * node, return 1; } - if (rc) + if (rc) { + //FIXME: free spool */ return rc; + } - if (!spool->notification) - spool->notification = default_notification; + //FIXME + if (NOTIFYQ_EMPTY(&spool->notification_queue)) + spool->notification_queue = default_notification; spool->dest_dir = wy_url_printable(spool->dest_url); register_spool(spool); - free(spool); *pdata = NULL; break; |