summaryrefslogtreecommitdiffstats
path: root/notify.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2016-10-16 20:01:10 +0100
committerThomas Adam <thomas@xteddy.org>2016-10-16 20:01:10 +0100
commitc67b7025882ee6bc2b3d5112dbc630c191f1fa2a (patch)
tree4c36124e376eac0235accd523be6545ccdccf6af /notify.c
parent3d8efdf310f475a6b9ed83814182c966de2bdab3 (diff)
parentddc4512d2e0eda6c705e002cb5dbf80719d709e1 (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'notify.c')
-rw-r--r--notify.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/notify.c b/notify.c
index 31f23b6f..cca4ff31 100644
--- a/notify.c
+++ b/notify.c
@@ -65,7 +65,7 @@ notify_hook(struct notify_entry *ne)
const char *name;
struct cmd_find_state fs;
struct hook *hook;
- struct cmd_q *hooks_cmdq;
+ struct cmd_q *new_cmdq, *loop;
name = notify_hooks[ne->type];
if (name == NULL)
@@ -86,14 +86,12 @@ notify_hook(struct notify_entry *ne)
return;
log_debug("notify hook %s", name);
- hooks_cmdq = cmdq_new(NULL);
- hooks_cmdq->flags |= CMD_Q_NOHOOKS;
+ new_cmdq = cmdq_get_command(hook->cmdlist, &fs, NULL, CMD_Q_NOHOOKS);
- cmd_find_copy_state(&hooks_cmdq->current, &fs);
- hooks_cmdq->parent = NULL;
+ for (loop = new_cmdq; loop != NULL; loop = loop->next)
+ loop->hook = xstrdup(name);
- cmdq_run(hooks_cmdq, hook->cmdlist, NULL);
- cmdq_free(hooks_cmdq);
+ cmdq_append(NULL, new_cmdq);
}
static void