From: tedu Date: Tue, 6 Feb 2018 20:38:47 +0000 (+0000) Subject: when we get SIGHUP, close conffd so it's reopened (and rewound). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7df55e898601083bfb58f5d7482a58e4d085ea93;p=openbsd when we get SIGHUP, close conffd so it's reopened (and rewound). problem and early fix by anton --- diff --git a/usr.sbin/rebound/rebound.c b/usr.sbin/rebound/rebound.c index 63688d5bf90..ecc1ef699ca 100644 --- a/usr.sbin/rebound/rebound.c +++ b/usr.sbin/rebound/rebound.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rebound.c,v 1.91 2017/08/22 15:47:13 deraadt Exp $ */ +/* $OpenBSD: rebound.c,v 1.92 2018/02/06 20:38:47 tedu Exp $ */ /* * Copyright (c) 2015 Ted Unangst * @@ -922,8 +922,6 @@ monitorloop(int ud, int ld, int ud6, int ld6, const char *confname) case EVFILT_VNODE: /* config file changed */ logmsg(LOG_INFO, "config changed, reloading"); - close(conffd); - conffd = -1; sleep(1); raise(SIGHUP); break; @@ -931,6 +929,8 @@ monitorloop(int ud, int ld, int ud6, int ld6, const char *confname) if (kev.ident == SIGHUP) { /* signaled. kill child. */ logmsg(LOG_INFO, "received HUP, restarting"); + close(conffd); + conffd = -1; hupped = 1; if (childdead) goto doublebreak;