sigpause() -> sigsuspend()
sigblock() -> sigprocmask()
This commit is contained in:
parent
d9dc3116bf
commit
ed1e8460bd
@ -968,13 +968,16 @@ LcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type,
|
||||
if (lcp->want_magic) {
|
||||
/* Validate magic number */
|
||||
if (magic == lcp->want_magic) {
|
||||
sigset_t emptyset;
|
||||
|
||||
log_Printf(LogLCP, "Magic is same (%08lx) - %d times\n",
|
||||
(u_long)magic, ++lcp->LcpFailedMagic);
|
||||
lcp->want_magic = GenerateMagic();
|
||||
memcpy(dec->nakend, cp, 6);
|
||||
dec->nakend += 6;
|
||||
ualarm(TICKUNIT * (4 + 4 * lcp->LcpFailedMagic), 0);
|
||||
sigpause(0);
|
||||
sigemptyset(&emptyset);
|
||||
sigsuspend(&emptyset);
|
||||
} else {
|
||||
lcp->his_magic = magic;
|
||||
memcpy(dec->ackend, cp, length);
|
||||
|
@ -63,11 +63,13 @@ tState2Nam(u_int state)
|
||||
void
|
||||
timer_Stop(struct pppTimer *tp)
|
||||
{
|
||||
int omask;
|
||||
sigset_t mask, omask;
|
||||
|
||||
omask = sigblock(sigmask(SIGALRM));
|
||||
sigemptyset(&mask);
|
||||
sigaddset(&mask, SIGALRM);
|
||||
sigprocmask(SIG_BLOCK, &mask, &omask);
|
||||
StopTimerNoBlock(tp);
|
||||
sigsetmask(omask);
|
||||
sigprocmask(SIG_SETMASK, &omask, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
@ -76,16 +78,18 @@ timer_Start(struct pppTimer *tp)
|
||||
struct itimerval itimer;
|
||||
struct pppTimer *t, *pt;
|
||||
u_long ticks = 0;
|
||||
int omask;
|
||||
sigset_t mask, omask;
|
||||
|
||||
omask = sigblock(sigmask(SIGALRM));
|
||||
sigemptyset(&mask);
|
||||
sigaddset(&mask, SIGALRM);
|
||||
sigprocmask(SIG_BLOCK, &mask, &omask);
|
||||
|
||||
if (tp->state != TIMER_STOPPED)
|
||||
StopTimerNoBlock(tp);
|
||||
|
||||
if (tp->load == 0) {
|
||||
log_Printf(LogTIMER, "%s timer[%p] has 0 load!\n", tp->name, tp);
|
||||
sigsetmask(omask);
|
||||
sigprocmask(SIG_SETMASK, &omask, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -121,7 +125,7 @@ timer_Start(struct pppTimer *tp)
|
||||
if (t)
|
||||
t->rest -= tp->rest;
|
||||
|
||||
sigsetmask(omask);
|
||||
sigprocmask(SIG_SETMASK, &omask, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user