Send the child SIGSTOPs and SIGCONTs

This commit is contained in:
Axel Wagner 2010-08-25 18:31:03 +02:00
parent 3c1a6384ab
commit a83e7699e7
3 changed files with 36 additions and 1 deletions

View File

@ -26,4 +26,16 @@ void start_child(char *command);
*/
void kill_child();
/*
* Sends a SIGSTOP to the child-process (if existent)
*
*/
void stop_child();
/*
* Sends a SIGCONT to the child-process (if existent)
*
*/
void cont_child();
#endif

View File

@ -176,7 +176,7 @@ void start_child(char *command) {
}
/*
* kill()s the child-prozess (if existend) and closes and
* kill()s the child-process (if existent) and closes and
* free()s the stdin- and sigchild-watchers
*
*/
@ -186,3 +186,23 @@ void kill_child() {
}
cleanup();
}
/*
* Sends a SIGSTOP to the child-process (if existent)
*
*/
void stop_child() {
if (child_pid != 0) {
kill(child_pid, SIGSTOP);
}
}
/*
* Sends a SIGCONT to the child-process (if existent)
*
*/
void cont_child() {
if (child_pid != 0) {
kill(child_pid, SIGCONT);
}
}

View File

@ -76,6 +76,7 @@ void hide_bars() {
SLIST_FOREACH(walk, outputs, slist) {
xcb_unmap_window(xcb_connection, walk->bar);
}
stop_child();
}
/*
@ -89,6 +90,8 @@ void unhide_bars() {
uint32_t mask;
uint32_t values[4];
cont_child();
SLIST_FOREACH(walk, outputs, slist) {
if (walk->bar == XCB_NONE) {
continue;