diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2016-09-04 16:10:32 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2016-09-04 16:10:32 +0000 |
commit | d9123b7946dc99b122c27b2c0cf255dac6a0051d (patch) | |
tree | dc63e5fe67b2d70f32c60ce0463a348c25ebe36a /usr.sbin | |
parent | 67931ff3e847aeb2415fbeadcaca9071768b8b88 (diff) |
The smtpd processes are not expected to ever leave their event loop.
So stop pretending that the *_shutdown() functions could ever be called
in this context, and just fatal() if event_dispatch() returns.
ok gilles@ sunil@ giovanni@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/ca.c | 7 | ||||
-rw-r--r-- | usr.sbin/smtpd/control.c | 7 | ||||
-rw-r--r-- | usr.sbin/smtpd/lka.c | 7 | ||||
-rw-r--r-- | usr.sbin/smtpd/pony.c | 7 | ||||
-rw-r--r-- | usr.sbin/smtpd/queue.c | 7 | ||||
-rw-r--r-- | usr.sbin/smtpd/scheduler.c | 7 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.c | 6 |
7 files changed, 21 insertions, 27 deletions
diff --git a/usr.sbin/smtpd/ca.c b/usr.sbin/smtpd/ca.c index b4420f16617..0ae36844821 100644 --- a/usr.sbin/smtpd/ca.c +++ b/usr.sbin/smtpd/ca.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ca.c,v 1.23 2016/09/01 10:54:25 eric Exp $ */ +/* $OpenBSD: ca.c,v 1.24 2016/09/04 16:10:31 eric Exp $ */ /* * Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org> @@ -127,9 +127,8 @@ ca(void) if (pledge("stdio", NULL) == -1) err(1, "pledge"); - if (event_dispatch() < 0) - fatal("event_dispatch"); - ca_shutdown(); + event_dispatch(); + fatalx("exited event loop"); return (0); } diff --git a/usr.sbin/smtpd/control.c b/usr.sbin/smtpd/control.c index d34b4ea0767..72554b51013 100644 --- a/usr.sbin/smtpd/control.c +++ b/usr.sbin/smtpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.115 2016/09/04 09:33:49 eric Exp $ */ +/* $OpenBSD: control.c,v 1.116 2016/09/04 16:10:31 eric Exp $ */ /* * Copyright (c) 2012 Gilles Chehade <gilles@poolp.org> @@ -296,9 +296,8 @@ control(void) if (pledge("stdio unix recvfd sendfd", NULL) == -1) err(1, "pledge"); - if (event_dispatch() < 0) - fatal("event_dispatch"); - control_shutdown(); + event_dispatch(); + fatalx("exited event loop"); return (0); } diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c index 7ca46e90184..2cd699b78ae 100644 --- a/usr.sbin/smtpd/lka.c +++ b/usr.sbin/smtpd/lka.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka.c,v 1.195 2016/09/03 15:54:14 gilles Exp $ */ +/* $OpenBSD: lka.c,v 1.196 2016/09/04 16:10:31 eric Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -448,9 +448,8 @@ lka(void) if (pledge("stdio rpath inet dns getpw recvfd proc exec", NULL) == -1) err(1, "pledge"); - if (event_dispatch() < 0) - fatal("event_dispatch"); - lka_shutdown(); + event_dispatch(); + fatalx("exited event loop"); return (0); } diff --git a/usr.sbin/smtpd/pony.c b/usr.sbin/smtpd/pony.c index 5883854641a..003804379fd 100644 --- a/usr.sbin/smtpd/pony.c +++ b/usr.sbin/smtpd/pony.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pony.c,v 1.14 2016/09/01 10:54:25 eric Exp $ */ +/* $OpenBSD: pony.c,v 1.15 2016/09/04 16:10:31 eric Exp $ */ /* * Copyright (c) 2014 Gilles Chehade <gilles@poolp.org> @@ -209,9 +209,8 @@ pony(void) if (pledge("stdio inet unix recvfd sendfd", NULL) == -1) err(1, "pledge"); - if (event_dispatch() < 0) - fatal("event_dispatch"); - pony_shutdown(); + event_dispatch(); + fatalx("exited event loop"); return (0); } diff --git a/usr.sbin/smtpd/queue.c b/usr.sbin/smtpd/queue.c index 06ca171756e..5204d2133ab 100644 --- a/usr.sbin/smtpd/queue.c +++ b/usr.sbin/smtpd/queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: queue.c,v 1.180 2016/09/01 10:54:25 eric Exp $ */ +/* $OpenBSD: queue.c,v 1.181 2016/09/04 16:10:31 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -720,9 +720,8 @@ queue(void) if (pledge("stdio rpath wpath cpath flock recvfd sendfd", NULL) == -1) err(1, "pledge"); - if (event_dispatch() < 0) - fatal("event_dispatch"); - queue_shutdown(); + event_dispatch(); + fatalx("exited event loop"); return (0); } diff --git a/usr.sbin/smtpd/scheduler.c b/usr.sbin/smtpd/scheduler.c index 8af72969367..c83080a522b 100644 --- a/usr.sbin/smtpd/scheduler.c +++ b/usr.sbin/smtpd/scheduler.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scheduler.c,v 1.53 2016/09/01 10:54:25 eric Exp $ */ +/* $OpenBSD: scheduler.c,v 1.54 2016/09/04 16:10:31 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -489,9 +489,8 @@ scheduler(void) if (pledge("stdio", NULL) == -1) err(1, "pledge"); - if (event_dispatch() < 0) - fatal("event_dispatch"); - scheduler_shutdown(); + event_dispatch(); + fatalx("exited event loop"); return (0); } diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c index 35f168135dc..c638e043e8c 100644 --- a/usr.sbin/smtpd/smtpd.c +++ b/usr.sbin/smtpd/smtpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.c,v 1.283 2016/09/04 09:33:49 eric Exp $ */ +/* $OpenBSD: smtpd.c,v 1.284 2016/09/04 16:10:31 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -1050,8 +1050,8 @@ smtpd(void) { "getpw sendfd proc exec id inet unix", NULL) == -1) err(1, "pledge"); - if (event_dispatch() < 0) - fatal("smtpd: event_dispatch"); + event_dispatch(); + fatalx("exited event loop"); return (0); } |