diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2008-12-27 16:45:02 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2008-12-27 16:45:02 +0000 |
commit | cc3d33fee9f269390eff5c105aefd20b9b3e5474 (patch) | |
tree | add3402999a4681a106267450b89963bf6f74ebe | |
parent | 1308e38dcb8217ea8850c82f918a90f608b1f8f5 (diff) |
Break showqueue and showrunqueue into 2 words; ok gilles@
-rw-r--r-- | usr.sbin/smtpd/parser.c | 17 | ||||
-rw-r--r-- | usr.sbin/smtpd/parser.h | 6 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpctl.c | 11 |
3 files changed, 18 insertions, 16 deletions
diff --git a/usr.sbin/smtpd/parser.c b/usr.sbin/smtpd/parser.c index 366c442ff0c..6ade78d00dd 100644 --- a/usr.sbin/smtpd/parser.c +++ b/usr.sbin/smtpd/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.2 2008/12/06 02:44:08 gilles Exp $ */ +/* $OpenBSD: parser.c,v 1.3 2008/12/27 16:45:01 jacekm Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -56,22 +56,21 @@ struct token { static const struct token t_main[]; static const struct token t_show[]; -static const struct token t_rdr[]; -static const struct token t_table[]; -static const struct token t_host[]; -static const struct token t_rdr_id[]; -static const struct token t_table_id[]; -static const struct token t_host_id[]; static const struct token t_main[] = { - {KEYWORD, "showqueue", SHOWQUEUE, NULL}, - {KEYWORD, "showrunqueue", SHOWRUNQUEUE, NULL}, + {KEYWORD, "show", NONE, t_show}, {KEYWORD, "monitor", MONITOR, NULL}, {KEYWORD, "reload", RELOAD, NULL}, {KEYWORD, "stop", SHUTDOWN, NULL}, {ENDTOKEN, "", NONE, NULL} }; +static const struct token t_show[] = { + {KEYWORD, "queue", SHOW_QUEUE, NULL}, + {KEYWORD, "runqueue", SHOW_RUNQUEUE, NULL}, + {ENDTOKEN, "", NONE, NULL} +}; + static struct parse_result res; struct parse_result * diff --git a/usr.sbin/smtpd/parser.h b/usr.sbin/smtpd/parser.h index 78846c992bc..f4d5351b1eb 100644 --- a/usr.sbin/smtpd/parser.h +++ b/usr.sbin/smtpd/parser.h @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.h,v 1.2 2008/12/06 02:44:08 gilles Exp $ */ +/* $OpenBSD: parser.h,v 1.3 2008/12/27 16:45:01 jacekm Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -21,8 +21,8 @@ enum actions { SHUTDOWN, RELOAD, MONITOR, - SHOWQUEUE, - SHOWRUNQUEUE + SHOW_QUEUE, + SHOW_RUNQUEUE }; struct parse_result { diff --git a/usr.sbin/smtpd/smtpctl.c b/usr.sbin/smtpd/smtpctl.c index 003ab999213..92dd314eb71 100644 --- a/usr.sbin/smtpd/smtpctl.c +++ b/usr.sbin/smtpd/smtpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpctl.c,v 1.2 2008/12/06 02:44:08 gilles Exp $ */ +/* $OpenBSD: smtpctl.c,v 1.3 2008/12/27 16:45:01 jacekm Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -101,10 +101,10 @@ main(int argc, char *argv[]) /* handle "disconnected" commands */ switch (res->action) { - case SHOWQUEUE: + case SHOW_QUEUE: show_queue(0); break; - case SHOWRUNQUEUE: + case SHOW_RUNQUEUE: show_runqueue(0); break; default: @@ -126,7 +126,6 @@ connected: if ((ibuf = malloc(sizeof(struct imsgbuf))) == NULL) err(1, NULL); imsg_init(ibuf, ctl_sock, NULL); - done = 0; /* process user request */ switch (res->action) { @@ -142,6 +141,8 @@ connected: case MONITOR: /* XXX */ break; + default: + err(1, "unknown request (%d)", res->action); } while (ibuf->w.queued) @@ -168,6 +169,8 @@ connected: break; case MONITOR: break; + default: + err(1, "unexpected reply (%d)", res->action); } /* insert imsg replies switch here */ |