summaryrefslogtreecommitdiff
path: root/src/events.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2003-05-15 07:36:21 +0000
committersabetts <sabetts>2003-05-15 07:36:21 +0000
commit55fadaecf93dfdf6a7c9510098057c5152e3b920 (patch)
treef1fc81a4aa497466f1cf5a497386ae994265984c /src/events.c
parent2d8945e4ee37ceee9d58e91681c6d3722a83c956 (diff)
downloadratpoison-55fadaecf93dfdf6a7c9510098057c5152e3b920.zip
* src/data.h (struct rp_frame): renamed from rp_window_frame. All
dependant code updated. * src/main.c: remove child_info global. Add rp_children global. (chld_handler): update the terminated and status fields of any terminated children. * src/events.c (handle_signals): loop through each child process and remove them from the list. Print a message for any child that doesn't return a 0 status. * src/data.h (rp_child_info): new fields, terminated and node. remove child_info global. Add rp_children global. * src/actions.c (spawn): Add the command to the list of children.
Diffstat (limited to 'src/events.c')
-rw-r--r--src/events.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/events.c b/src/events.c
index 94647a5..b827751 100644
--- a/src/events.c
+++ b/src/events.c
@@ -68,7 +68,7 @@ new_window (XCreateWindowEvent *e)
static void
unmap_notify (XEvent *ev)
{
- rp_window_frame *frame;
+ rp_frame *frame;
rp_window *win;
/* ignore SubstructureNotify unmaps. */
@@ -775,7 +775,24 @@ handle_signals ()
if (chld_signalled > 0)
{
- marked_message_printf (0,0, " Command not found ");
+ rp_child_info *cur;
+ struct list_head *iter, *tmp;
+
+ /* Report and remove terminated processes. */
+ list_for_each_safe_entry (cur, iter, tmp, &rp_children, node)
+ {
+ if (cur->terminated)
+ {
+ /* Report any child that didn't return 0. */
+ if (cur->status != 0)
+ marked_message_printf (0,0, " /bin/sh -c \"%s\" finished (%d) ",
+ cur->cmd, cur->status);
+ free (cur->cmd);
+ free (cur);
+ list_del (&cur->node);
+ }
+ }
+
chld_signalled = 0;
}