summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/smtpctl.c
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2012-11-23 09:25:45 +0000
committerEric Faurot <eric@cvs.openbsd.org>2012-11-23 09:25:45 +0000
commit23bce6aeda84d214fb7ec2b091f5f15167c8d3fb (patch)
tree5f760e85805d1343fec336de9a025ed223572293 /usr.sbin/smtpd/smtpctl.c
parent48da79ef884f444b89831aac87683c10daa45c77 (diff)
Replace the qwalk API (to retreive on disk envelopes at runtime) with
a simple QOP_WALK queue operation. Some knf and formating fixes while there. ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/smtpctl.c')
-rw-r--r--usr.sbin/smtpd/smtpctl.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/usr.sbin/smtpd/smtpctl.c b/usr.sbin/smtpd/smtpctl.c
index 3ecf6c54ec1..aa063e1f1f3 100644
--- a/usr.sbin/smtpd/smtpctl.c
+++ b/usr.sbin/smtpd/smtpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpctl.c,v 1.97 2012/11/20 09:47:46 eric Exp $ */
+/* $OpenBSD: smtpctl.c,v 1.98 2012/11/23 09:25:44 eric Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -520,27 +520,19 @@ show_stats_output(void)
static void
show_queue(int flags)
{
- struct qwalk *q;
struct envelope envelope;
- uint64_t evpid;
+ int r;
log_init(1);
if (chroot(PATH_SPOOL) == -1 || chdir(".") == -1)
err(1, "%s", PATH_SPOOL);
- q = qwalk_new(0);
-
- while (qwalk(q, &evpid)) {
- if (! queue_envelope_load(evpid, &envelope))
- continue;
- show_queue_envelope(&envelope, flags);
- }
-
- qwalk_close(q);
+ while ((r = queue_envelope_walk(&envelope)) != -1)
+ if (r)
+ show_queue_envelope(&envelope, flags);
}
-
static void
show_queue_envelope(struct envelope *e, int online)
{