summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/cmd.c
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-12-30 02:03:29 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-12-30 02:03:29 +0000
commiteba90c397238078d4145046f9f6056ced60b52a2 (patch)
tree066c330f8d693daf3ac9fd783129c19fb2049af8 /usr.bin/cvs/cmd.c
parent0a6f2c57253516d05a4ecc720d8b82cc8f25697a (diff)
major cleanup of the functions handling the remote cvs protocol.
makes the code a lot more readable and understandable. ok xsa@ and niallo@
Diffstat (limited to 'usr.bin/cvs/cmd.c')
-rw-r--r--usr.bin/cvs/cmd.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/usr.bin/cvs/cmd.c b/usr.bin/cvs/cmd.c
index 15f30b8b8ee..b3d1d5b742c 100644
--- a/usr.bin/cvs/cmd.c
+++ b/usr.bin/cvs/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.39 2005/12/10 20:27:45 joris Exp $ */
+/* $OpenBSD: cmd.c,v 1.40 2005/12/30 02:03:28 joris Exp $ */
/*
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
* All rights reserved.
@@ -235,8 +235,8 @@ cvs_startcmd(struct cvs_cmd *cmd, int argc, char **argv)
cvs_log(LP_TRACE, "cvs_startcmd() CVSROOT=%s", root->cr_str);
- if ((root->cr_method != CVS_METHOD_LOCAL) && (cvs_connect(root) < 0))
- return (CVS_EX_PROTO);
+ if (root->cr_method != CVS_METHOD_LOCAL)
+ cvs_connect(root);
if (cmd->cmd_pre_exec != NULL) {
if ((ret = cmd->cmd_pre_exec(root)) != 0)
@@ -273,24 +273,19 @@ cvs_startcmd(struct cvs_cmd *cmd, int argc, char **argv)
cf = cvs_file_loadinfo(".", CF_NOFILES, NULL, NULL, 1);
if (cf == NULL)
return (CVS_EX_DATA);
- if (cvs_senddir(root, cf) < 0) {
- cvs_file_free(cf);
- return (CVS_EX_PROTO);
- }
+ cvs_senddir(root, cf);
cvs_file_free(cf);
}
if (cmd->cmd_flags & CVS_CMD_SENDARGS2) {
- for (i = 0; i < argc; i++) {
- if (cvs_sendarg(root, argv[i], 0) < 0)
- return (CVS_EX_PROTO);
- }
+ for (i = 0; i < argc; i++)
+ cvs_sendarg(root, argv[i], 0);
}
- if (cmd->cmd_req != CVS_REQ_NONE &&
- cvs_sendreq(root, cmd->cmd_req,
- (cmd->cmd_op == CVS_OP_INIT) ? root->cr_dir : NULL) < 0)
- return (CVS_EX_PROTO);
+ if (cmd->cmd_req != CVS_REQ_NONE) {
+ cvs_sendreq(root, cmd->cmd_req,
+ (cmd->cmd_op == CVS_OP_INIT) ? root->cr_dir : NULL);
+ }
}
if (cmd->cmd_cleanup != NULL)