apps: signal usage cleanup

This commit is contained in:
K. Lange 2018-10-31 18:58:10 +09:00
parent 758a8b6cf4
commit fea6693410
8 changed files with 7 additions and 8 deletions

View File

@ -89,6 +89,7 @@ static void check_click(struct yutani_msg_window_mouse_event * evt) {
static void sig_usr2(int sig) {
yutani_set_stack(yctx, wallpaper_window, YUTANI_ZORDER_BOTTOM);
yutani_flip(yctx, wallpaper_window);
signal(SIGUSR2, sig_usr2);
}
int main (int argc, char ** argv) {

View File

@ -1999,6 +1999,7 @@ static void yutani_display_resize_handle(int signum) {
(void)signum;
TRACE("Display change request, one moment.");
_static_yg->resize_on_next = 1;
signal(SIGWINEVENT, yutani_display_resize_handle);
}
/**

View File

@ -11,7 +11,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <sys/wait.h>
#include <toaru/auth.h>

View File

@ -193,6 +193,7 @@ static void toggle_hide_panel(void) {
static void sig_int(int sig) {
printf("Received shutdown signal in panel!\n");
_continue = 0;
signal(SIGINT, sig_int);
}
static void launch_application(char * app) {
@ -1111,6 +1112,7 @@ static void sig_usr2(int sig) {
yutani_set_stack(yctx, panel, YUTANI_ZORDER_TOP);
yutani_flip(yctx, panel);
bind_keys();
signal(SIGUSR2, sig_usr2);
}
int main (int argc, char ** argv) {

View File

@ -7,7 +7,6 @@
*
*/
#include <sys/stat.h>
#include <sys/signal.h>
#include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
@ -15,7 +14,6 @@
#include <string.h>
#include <unistd.h>
#include <dirent.h>
#include <signal.h>
typedef struct process {
int pid;

View File

@ -12,7 +12,6 @@
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <termios.h>
#include <fcntl.h>

View File

@ -350,9 +350,10 @@ volatile int break_while = 0;
pid_t suspended_pgid = 0;
hashmap_t * job_hash = NULL;
void sig_pass(int sig) {
void sig_break_loop(int sig) {
/* Interrupt handler */
break_while = sig;
signal(sig, sig_break_loop);
}
void redraw_prompt_func(rline_context_t * context) {
@ -1500,8 +1501,7 @@ int main(int argc, char ** argv) {
pid = getpid();
signal(SIGINT, sig_pass);
signal(SIGWINCH, sig_pass);
signal(SIGINT, sig_break_loop);
job_hash = hashmap_create_int(10);

View File

@ -13,7 +13,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <signal.h>
#include <termios.h>
#include <errno.h>
#include <pwd.h>