forked from Imagelibrary/rtems
2005-05-20 Sergei Organov <osv@topconrd.ru>
PR 750/networking * pppd/sys-rtems.c: Avoid NULL dereference in wait_input().
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2005-05-20 Sergei Organov <osv@topconrd.ru>
|
||||||
|
|
||||||
|
PR 750/networking
|
||||||
|
* pppd/sys-rtems.c: Avoid NULL dereference in wait_input().
|
||||||
|
|
||||||
2004-04-03 Wilfried Busalski <w.busalski@lancier-monitoring.de>
|
2004-04-03 Wilfried Busalski <w.busalski@lancier-monitoring.de>
|
||||||
|
|
||||||
PR 599/pppd
|
PR 599/pppd
|
||||||
|
|||||||
@@ -513,13 +513,21 @@ void
|
|||||||
wait_input(timo)
|
wait_input(timo)
|
||||||
struct timeval *timo;
|
struct timeval *timo;
|
||||||
{
|
{
|
||||||
rtems_interval ticks;
|
|
||||||
rtems_event_set events;
|
rtems_event_set events;
|
||||||
|
rtems_interval ticks = 0;
|
||||||
|
rtems_option wait = RTEMS_WAIT;
|
||||||
|
|
||||||
ticks = ((timo->tv_sec*1000000)+timo->tv_usec)/rtems_bsdnet_microseconds_per_tick;
|
if(timo) {
|
||||||
if ( ticks > 0 ) {
|
if(timo->tv_sec == 0 && timo->tv_usec == 0)
|
||||||
rtems_event_receive(RTEMS_EVENT_31, (RTEMS_EVENT_ANY|RTEMS_WAIT), ticks, &events);
|
wait = RTEMS_NO_WAIT;
|
||||||
|
else {
|
||||||
|
ticks = (timo->tv_sec * 1000000 + timo->tv_usec) /
|
||||||
|
rtems_bsdnet_microseconds_per_tick;
|
||||||
|
if(ticks <= 0)
|
||||||
|
ticks = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
rtems_event_receive(RTEMS_EVENT_31, RTEMS_EVENT_ANY | wait, ticks, &events);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user