From 3abec42c81ead8a2286d76641df351ef1f88a4d6 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 9 May 2009 16:03:27 +0200 Subject: [PATCH] spawn: call startup notification hooks on time out Signed-off-by: Julien Danjou --- spawn.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spawn.c b/spawn.c index 5f6ebdb17..1d41480ef 100644 --- a/spawn.c +++ b/spawn.c @@ -67,6 +67,16 @@ static void spawn_monitor_timeout(struct ev_loop *loop, ev_timer *w, int revents) { spawn_sequence_remove(w->data); + /* send a timeout event to hook function */ + if(globalconf.hooks.startup_notification != LUA_REFNIL) + { + lua_createtable(globalconf.L, 0, 2); + lua_pushstring(globalconf.L, sn_startup_sequence_get_id(w->data)); + lua_setfield(globalconf.L, -2, "id"); + lua_pushliteral(globalconf.L, "timedout"); + lua_setfield(globalconf.L, -2, "type"); + luaA_dofunction(globalconf.L, globalconf.hooks.startup_notification, 1, 0); + } sn_startup_sequence_unref(w->data); p_delete(&w); }