From f65d56a4911b4f47789265594aaa81a6ed402e89 Mon Sep 17 00:00:00 2001 From: yasuoka Date: Wed, 24 Jun 2015 04:57:55 +0000 Subject: [PATCH] Use the return value of event_loop() properly. Also abort(3) if event_loop() returns abnormally which is unexpected. diff from Yuuichi Someya --- usr.sbin/npppd/npppd/npppd.c | 10 ++++++---- 1 file 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 /* 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 */ -- 2.20.1