Commit Graph

14 Commits

Author SHA1 Message Date
Uli Schlachter 34d37c00c8 spawn: add spawn_system() which works like system()
This adds a small function which behaves exactly like libc's system(), but also
clears the masked signal set in the child process.

This is needed because libev 3.8 masks signals. :(

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-03 10:32:39 +02:00
Uli Schlachter 47f3a4b3df Clear the signal mask for child processes
This adds a callback function which glib calls after it fork()'d and did all the
necessary setup. This callback function clears our signal mask.

This is necessary because libev 3.8 and later use signalfd and therefor have to
add those signals to the signal mask. Processes started through awesome would
inherit this signal mask and I can tell you, some app which ignores ctrl-c
confuses people a lot.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-25 11:34:45 +02:00
Uli Schlachter 7e5097aa09 Inline g_spawn_command_line_async() into awesome
This adds a new function spawn_proc_helper() which just contains a copy of
g_spawn_command_line_async()'s source code. This means that there should be no
behavior change at all here.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-25 11:34:41 +02:00
Julien Danjou 318907efa4 spawn: fix crash with command starting with white space
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-09 15:59:38 +02:00
Julien Danjou f5591745a6 spawn: fix sequence ref count again
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-05-12 08:11:35 +02:00
Julien Danjou dd4d435db9 spawn: fix hook call on timeout
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-05-10 01:10:39 +02:00
Julien Danjou 3abec42c81 spawn: call startup notification hooks on time out
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-05-09 16:03:27 +02:00
Julien Danjou ff46fd7e0a spawn: fix reference counting of sequences
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-05-09 16:02:29 +02:00
Julien Danjou 0705fbf29d spawn: use glib spawn module to catch error
This is a lot better than our previous code. We can now report execution
error to Lua directly.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-27 20:18:39 +02:00
Julien Danjou dc29720ef7 Replace lua_newtable() with lua_createtable()
Lua can preallocate space in table for array or non-array elements type.
This should improve performance when setting table, so when we can we
use lua_createtable() since this is just a gain.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-25 15:04:27 +02:00
Julien Danjou 486ef71a7f screen: replace screens pointer by a screen_t array
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-17 16:14:09 +02:00
Julien Danjou f4221a1fdf spawn: add support for startup-notification
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-14 14:23:38 +02:00
Uli Schlachter 95457c5ab7 Move the definition of globalconf into a header file
Pretty much every single source file needs this struct, so it makes sense to
define it in a common header instead of in every single .c file.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-10 16:32:42 +02:00
Julien Danjou cbf55449a3 luaa: split spawn() into spawn.c
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-03 13:09:17 +02:00