mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
[signals] Removed code related to SIGALRM
links does not have such code.
This commit is contained in:
parent
6684f4bdef
commit
e47a482590
@ -1272,10 +1272,8 @@ select_loop(void (*init)(void))
|
||||
|
||||
has_timer = get_next_timer_time(&t);
|
||||
if (!w_max && !has_timer) break;
|
||||
critical_section = 1;
|
||||
|
||||
if (check_signals()) {
|
||||
critical_section = 0;
|
||||
continue;
|
||||
}
|
||||
#if 0
|
||||
@ -1309,8 +1307,6 @@ select_loop(void (*init)(void))
|
||||
* might change errno. */
|
||||
const int errno_from_select = errno;
|
||||
|
||||
critical_section = 0;
|
||||
uninstall_alarm();
|
||||
if (errno_from_select != EINTR) {
|
||||
ERROR(gettext("The call to %s failed: %d (%s)"),
|
||||
"select()", errno_from_select, (char *) strerror(errno_from_select));
|
||||
@ -1322,8 +1318,6 @@ select_loop(void (*init)(void))
|
||||
}
|
||||
|
||||
select_errors = 0;
|
||||
critical_section = 0;
|
||||
uninstall_alarm();
|
||||
check_signals();
|
||||
/*printf("sel: %d\n", n);*/
|
||||
check_timers(&last_time);
|
||||
|
@ -245,9 +245,6 @@ struct signal_info {
|
||||
};
|
||||
|
||||
static struct signal_info signal_info[NUM_SIGNALS];
|
||||
volatile int critical_section = 0;
|
||||
|
||||
static void check_for_select_race(void);
|
||||
|
||||
/* TODO: In order to gain better portability, we should use signal() instead.
|
||||
* Highest care should be given to careful watching of which signals are
|
||||
@ -276,7 +273,6 @@ got_signal(int sig)
|
||||
}
|
||||
|
||||
s->mask = 1;
|
||||
check_for_select_race();
|
||||
|
||||
if (can_write(signal_pipe[1])) {
|
||||
int wr;
|
||||
@ -324,41 +320,6 @@ install_signal_handler(int sig, void (*fn)(void *), void *data, int critical)
|
||||
#endif
|
||||
}
|
||||
|
||||
static volatile int pending_alarm = 0;
|
||||
|
||||
#ifdef SIGALRM
|
||||
static void
|
||||
alarm_handler(void *x)
|
||||
{
|
||||
pending_alarm = 0;
|
||||
check_for_select_race();
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
check_for_select_race(void)
|
||||
{
|
||||
if (critical_section) {
|
||||
#ifdef SIGALRM
|
||||
install_signal_handler(SIGALRM, alarm_handler, NULL, 1);
|
||||
#endif
|
||||
pending_alarm = 1;
|
||||
#ifdef HAVE_ALARM
|
||||
alarm(1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
uninstall_alarm(void)
|
||||
{
|
||||
pending_alarm = 0;
|
||||
#ifdef HAVE_ALARM
|
||||
alarm(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifdef SIGCHLD
|
||||
static void
|
||||
sig_chld(void *p)
|
||||
|
@ -11,13 +11,10 @@ struct terminal;
|
||||
|
||||
#define NUM_SIGNALS 32
|
||||
|
||||
extern volatile int critical_section;
|
||||
|
||||
void install_signal_handler(int, void (*)(void *), void *, int);
|
||||
void set_sigcld(void);
|
||||
void sig_ctrl_c(struct terminal *term);
|
||||
void clear_signal_mask_and_handlers(void);
|
||||
void uninstall_alarm(void);
|
||||
void handle_basic_signals(struct terminal *term);
|
||||
void unhandle_terminal_signals(struct terminal *term);
|
||||
int check_signals(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user