diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-03-13 09:36:07 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-03-13 09:36:07 +0000 |
commit | dd04fb31dcdfd5cdb8b83a194fb03880f0a4854b (patch) | |
tree | 66a1d7675f61815b715acc1c834ab1ad97b7e2d4 /usr.sbin/ospfd/database.c | |
parent | 72165f8a1a149e38e5164d3bde4360b52a8a4ffc (diff) |
The return value of the start/stop timer functions is almost never checked.
Switch them to void functions and check if evtimer_add/del fails -- in which
case we fatal() as there is no useful way to recover in such an event.
OK norby@
Diffstat (limited to 'usr.sbin/ospfd/database.c')
-rw-r--r-- | usr.sbin/ospfd/database.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/usr.sbin/ospfd/database.c b/usr.sbin/ospfd/database.c index 24fed999a7b..0610c84da58 100644 --- a/usr.sbin/ospfd/database.c +++ b/usr.sbin/ospfd/database.c @@ -1,4 +1,4 @@ -/* $OpenBSD: database.c,v 1.18 2006/03/09 13:34:19 claudio Exp $ */ +/* $OpenBSD: database.c,v 1.19 2006/03/13 09:36:06 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -393,28 +393,30 @@ db_tx_timer(int fd, short event, void *arg) if (nbr->master) { timerclear(&tv); tv.tv_sec = nbr->iface->rxmt_interval; - evtimer_add(&nbr->db_tx_timer, &tv); + if (evtimer_add(&nbr->db_tx_timer, &tv) == -1) + fatal("db_tx_timer"); } } -int +void start_db_tx_timer(struct nbr *nbr) { struct timeval tv; if (nbr == nbr->iface->self) - return (0); + return; timerclear(&tv); - - return (evtimer_add(&nbr->db_tx_timer, &tv)); + if (evtimer_add(&nbr->db_tx_timer, &tv) == -1) + fatal("start_db_tx_timer"); } -int +void stop_db_tx_timer(struct nbr *nbr) { if (nbr == nbr->iface->self) - return (0); + return; - return (evtimer_del(&nbr->db_tx_timer)); + if (evtimer_del(&nbr->db_tx_timer) == -1) + fatal("stop_db_tx_timer"); } |