aboutsummaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-04-27 13:44:31 +0300
committerSergey Poznyakoff <gray@gnu.org>2020-04-27 13:44:31 +0300
commit9dff021e31a300dcd5eda941d9e4992a6a8e465a (patch)
tree9ba56aa2ccbd7c24b1d1e8535c8e3eeef25f27cf /src/config.c
parente19cf8e1303700b5b2e4f3e525285f63a3c7b51f (diff)
downloadwydawca-9dff021e31a300dcd5eda941d9e4992a6a8e465a.tar.gz
wydawca-9dff021e31a300dcd5eda941d9e4992a6a8e465a.tar.bz2
Use BSD queue macros to implement queues and linked lists.
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c18
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;

Return to:

Send suggestions and report system problems to the System administrator.