summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxsa <xsa@openbsd.org>2006-01-04 14:58:12 +0000
committerxsa <xsa@openbsd.org>2006-01-04 14:58:12 +0000
commit6884ad98b1a2b62a7673c728e984acb8bc4ff5e9 (patch)
treea96538506a485d45a266259f6bd626ec06f241b2
parentnviic in SEE ALSO too. (diff)
downloadwireguard-openbsd-6884ad98b1a2b62a7673c728e984acb8bc4ff5e9.tar.xz
wireguard-openbsd-6884ad98b1a2b62a7673c728e984acb8bc4ff5e9.zip
make cvs_sendresp() return type void; ok joris@.
-rw-r--r--usr.bin/cvs/proto.c13
-rw-r--r--usr.bin/cvs/proto.h4
-rw-r--r--usr.bin/cvs/req.c28
3 files changed, 14 insertions, 31 deletions
diff --git a/usr.bin/cvs/proto.c b/usr.bin/cvs/proto.c
index 04ccb3071f7..dae970bdd08 100644
--- a/usr.bin/cvs/proto.c
+++ b/usr.bin/cvs/proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proto.c,v 1.86 2006/01/02 17:38:17 joris Exp $ */
+/* $OpenBSD: proto.c,v 1.87 2006/01/04 14:58:12 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -703,19 +703,15 @@ cvs_getln(struct cvsroot *root, char *lbuf, size_t len)
*
* Send a response of type <rid> to the client, with optional arguments
* contained in <arg>, which should not be terminated by a newline.
- * Returns 0 on success, or -1 on failure.
*/
-int
+void
cvs_sendresp(u_int rid, const char *arg)
{
int ret;
struct cvs_resp *resp;
- resp = cvs_resp_getbyid(rid);
- if (resp == NULL) {
- cvs_log(LP_ERR, "unsupported response type %u", rid);
- return (-1);
- }
+ if ((resp = cvs_resp_getbyid(rid)) == NULL);
+ fatal("unsupported response type %u", rid);
ret = fputs(resp->resp_str, stdout);
if (ret == EOF) {
@@ -727,7 +723,6 @@ cvs_sendresp(u_int rid, const char *arg)
}
putc('\n', stdout);
}
- return (0);
}
diff --git a/usr.bin/cvs/proto.h b/usr.bin/cvs/proto.h
index 97aea099f1c..1ab98dadcbc 100644
--- a/usr.bin/cvs/proto.h
+++ b/usr.bin/cvs/proto.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: proto.h,v 1.11 2006/01/02 09:42:20 xsa Exp $ */
+/* $OpenBSD: proto.h,v 1.12 2006/01/04 14:58:12 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -181,7 +181,7 @@ char* cvs_resp_getvalid(void);
void cvs_sendreq(struct cvsroot *, u_int, const char *);
void cvs_getresp(struct cvsroot *);
-int cvs_sendresp(u_int, const char *);
+void cvs_sendresp(u_int, const char *);
void cvs_getln(struct cvsroot *, char *, size_t);
void cvs_senddir(struct cvsroot *, CVSFILE *);
void cvs_sendarg(struct cvsroot *, const char *, int);
diff --git a/usr.bin/cvs/req.c b/usr.bin/cvs/req.c
index b24264d26be..583b213ec31 100644
--- a/usr.bin/cvs/req.c
+++ b/usr.bin/cvs/req.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: req.c,v 1.40 2006/01/02 08:11:56 xsa Exp $ */
+/* $OpenBSD: req.c,v 1.41 2006/01/04 14:58:12 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -182,11 +182,7 @@ cvs_req_handle(char *line)
static int
cvs_req_noop(int reqid, char *line)
{
- int ret;
-
- ret = cvs_sendresp(CVS_RESP_OK, NULL);
- if (ret < 0)
- return (-1);
+ cvs_sendresp(CVS_RESP_OK, NULL);
return (0);
}
@@ -216,9 +212,8 @@ cvs_req_validreq(int reqid, char *line)
if (vreq == NULL)
return (-1);
- if ((cvs_sendresp(CVS_RESP_VALIDREQ, vreq) < 0) ||
- (cvs_sendresp(CVS_RESP_OK, NULL) < 0))
- return (-1);
+ cvs_sendresp(CVS_RESP_VALIDREQ, vreq);
+ cvs_sendresp(CVS_RESP_OK, NULL);
return (0);
}
@@ -425,11 +420,7 @@ cvs_req_filestate(int reqid, char *line)
static int
cvs_req_expandmod(int reqid, char *line)
{
- int ret;
-
- ret = cvs_sendresp(CVS_RESP_OK, NULL);
- if (ret < 0)
- return (-1);
+ cvs_sendresp(CVS_RESP_OK, NULL);
return (0);
}
@@ -580,7 +571,6 @@ cvs_req_gzipstream(int reqid, char *line)
static int
cvs_req_command(int reqid, char *line)
{
- int ret = 0;
struct cvs_cmd *cmdp;
cmdp = cvs_findcmdbyreq(reqid);
@@ -600,10 +590,8 @@ cvs_req_command(int reqid, char *line)
if (cmdp->cmd_op != CVS_OP_VERSION)
cvs_chdir(cvs_server_tmpdir, 1);
- ret = cvs_startcmd(cmdp, cvs_req_nargs, cvs_req_args);
-
- if (ret == 0)
- ret = cvs_sendresp(CVS_RESP_OK, NULL);
+ if (cvs_startcmd(cmdp, cvs_req_nargs, cvs_req_args) == 0)
+ cvs_sendresp(CVS_RESP_OK, NULL);
- return (ret);
+ return (0);
}