From 8484c4ce31e7964c777f04b56d921ef9074628df Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 2 Oct 1996 16:51:32 +0000 Subject: Make the check for whether --flush and --all work protocol-independent. svn path=/trunk/; revision=205 --- driver.c | 18 ++++++++++++++++++ pop2.c | 10 ---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/driver.c b/driver.c index 8f9a8f04..7ff063b2 100644 --- a/driver.c +++ b/driver.c @@ -493,6 +493,24 @@ struct method *proto; #endif /* HAVE_RRESVPORT_H */ int num, count, deletions = 0; + /* lacking methods, there are some options that may fail */ + if (!proto->is_old) + { + /* check for unsupported options */ + if (queryctl->flush) { + fprintf(stderr, + "Option --flush is not supported with %s\n", + proto->name); + return(PS_SYNTAX); + } + else if (queryctl->fetchall) { + fprintf(stderr, + "Option --all is not supported with %s\n", + proto->name); + return(PS_SYNTAX); + } + } + tagnum = 0; protocol = proto; diff --git a/pop2.c b/pop2.c index 09378ce5..2e808b2d 100644 --- a/pop2.c +++ b/pop2.c @@ -145,15 +145,5 @@ const static struct method pop2 = int doPOP2 (queryctl) struct hostrec *queryctl; { - /* check for unsupported options */ - if (queryctl->flush) { - fprintf(stderr,"Option --flush is not supported with POP2\n"); - return(PS_SYNTAX); - } - else if (queryctl->fetchall) { - fprintf(stderr,"Option --all is not supported with POP2\n"); - return(PS_SYNTAX); - } - return(do_protocol(queryctl, &pop2)); } -- cgit v1.2.3