summaryrefslogtreecommitdiffstats
path: root/usr.sbin/npppd
diff options
context:
space:
mode:
authoryasuoka <yasuoka@openbsd.org>2015-06-24 04:57:55 +0000
committeryasuoka <yasuoka@openbsd.org>2015-06-24 04:57:55 +0000
commitf65d56a4911b4f47789265594aaa81a6ed402e89 (patch)
tree53ed9a2451b761b0c49cb28aa8683a0dce18c9dd /usr.sbin/npppd
parentImprove and fix typo in the comment. (diff)
downloadwireguard-openbsd-f65d56a4911b4f47789265594aaa81a6ed402e89.tar.xz
wireguard-openbsd-f65d56a4911b4f47789265594aaa81a6ed402e89.zip
Use the return value of event_loop() properly. Also abort(3) if
event_loop() returns abnormally which is unexpected. diff from Yuuichi Someya
Diffstat (limited to 'usr.sbin/npppd')
-rw-r--r--usr.sbin/npppd/npppd/npppd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/npppd/npppd/npppd.c b/usr.sbin/npppd/npppd/npppd.c
index 584288625ec..a6125f486b9 100644
--- a/usr.sbin/npppd/npppd/npppd.c
+++ b/usr.sbin/npppd/npppd/npppd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: npppd.c,v 1.40 2015/01/19 01:48:59 deraadt Exp $ */
+/* $OpenBSD: npppd.c,v 1.41 2015/06/24 04:57:55 yasuoka Exp $ */
/*-
* Copyright (c) 2005-2008,2009 Internet Initiative Japan Inc.
@@ -29,7 +29,7 @@
* Next pppd(nppd). This file provides a npppd daemon process and operations
* for npppd instance.
* @author Yasuoka Masahiko
- * $Id: npppd.c,v 1.40 2015/01/19 01:48:59 deraadt Exp $
+ * $Id: npppd.c,v 1.41 2015/06/24 04:57:55 yasuoka Exp $
*/
#include "version.h"
#include <sys/param.h> /* ALIGNED_POINTER */
@@ -386,12 +386,14 @@ npppd_start(npppd *_this)
int rval = 0;
npppd_reset_timer(_this);
- while ((event_loop(EVLOOP_ONCE)) == 0) {
+ while ((rval = event_loop(EVLOOP_ONCE)) == 0) {
if (_this->finalized != 0)
break;
}
- if (rval != 0)
+ if (rval != 0) {
log_printf(LOG_CRIT, "event_loop() failed: %m");
+ abort();
+ }
}
/** stop the npppd */