X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=gui.c;h=40d521bcf81ceb546a9675b5729c182109a07cf6;hb=8ea7c22ed366c4c895f431aa663b9bb227b2bead;hp=d8e200342fc991380445b6fa120ac2d2560bb05e;hpb=3689799ede7bba230ca544ac953392b428c3d662;p=paraslash.git diff --git a/gui.c b/gui.c index d8e20034..40d521bc 100644 --- a/gui.c +++ b/gui.c @@ -6,9 +6,9 @@ /** \file gui.c ncurses-based interface for paraslash */ +#include #include #include - #include "gui.cmdline.h" #include "para.h" #include "gui.h" @@ -23,7 +23,6 @@ /** define the array of error lists needed by para_gui */ INIT_GUI_ERRLISTS; -extern const char *status_item_list[NUM_STAT_ITEMS]; static char *stat_content[NUM_STAT_ITEMS]; #define STANDARD_STATUS_BAR "para_gui " PACKAGE_VERSION " (hit ? for help)" @@ -490,7 +489,7 @@ static void setup_signal_handling(void) para_install_sighandler(SIGCHLD); para_install_sighandler(SIGWINCH); para_install_sighandler(SIGUSR1); - signal(SIGPIPE, SIG_IGN); +// signal(SIGPIPE, SIG_IGN); signal(SIGHUP, SIG_IGN); } @@ -726,10 +725,11 @@ static void init_curses(void) static void check_sigchld(void) { + int ret; pid_t pid; reap_next_child: - pid = para_reap_child(); - if (pid <= 0) + ret = para_reap_child(&pid); + if (ret <= 0) return; if (pid == cmd_pid) { cmd_pid = 0; @@ -748,7 +748,7 @@ static int check_stat_line(char *line, __a_unused void *data) // PARA_INFO_LOG("%s: checking: %s\n", __func__, line); i = stat_line_valid(line); if (i >= 0) { - line += strlen(status_item_list[i]) + 1; + line += strlen(status_item_list[i]) + 2; free(stat_content[i]); stat_content[i] = para_strdup(line); print_stat_item(i); @@ -917,8 +917,8 @@ repeat: close(audiod_pipe); audiod_pipe = -1; clear_all_items(); - free(stat_content[SI_STATUS_BAR]); - stat_content[SI_STATUS_BAR] = + free(stat_content[SI_BASENAME]); + stat_content[SI_BASENAME] = para_strdup("audiod not running!?"); print_all_items(); }