try harder with a goto. diagnosis and original fix by tb.
-/* $OpenBSD: rebound.c,v 1.81 2017/04/06 21:16:14 tedu Exp $ */
+/* $OpenBSD: rebound.c,v 1.82 2017/04/13 15:32:15 tedu Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
logmsg(LOG_INFO, "received HUP, restarting");
hupped = 1;
if (childdead)
- break;
+ goto doublebreak;
kill(child, SIGHUP);
} else if (kev.ident == SIGTERM) {
/* good bye */
logmsg(LOG_INFO, "observed child exit");
childdead = 1;
if (hupped)
- break;
+ goto doublebreak;
memset(&ts, 0, sizeof(ts));
ts.tv_sec = 1;
timeout = &ts;
break;
}
}
+doublebreak:
wait(NULL);
}
return 1;