summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/checkout.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/checkout.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/checkout.c')
-rw-r--r--usr.bin/cvs/checkout.c69
1 files changed, 32 insertions, 37 deletions
diff --git a/usr.bin/cvs/checkout.c b/usr.bin/cvs/checkout.c
index 675eccfc108..c52968e25d4 100644
--- a/usr.bin/cvs/checkout.c
+++ b/usr.bin/cvs/checkout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: checkout.c,v 1.41 2005/12/03 01:02:08 joris Exp $ */
+/* $OpenBSD: checkout.c,v 1.42 2005/12/30 02:03:28 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -253,50 +253,45 @@ cvs_checkout_pre_exec(struct cvsroot *root)
* a checkout.
*/
for (i = 0; i < co_nmod; i++)
- if (cvs_sendarg(root, co_mods[i], 0) < 0)
- return (CVS_EX_PROTO);
- if (cvs_sendreq(root, CVS_REQ_DIRECTORY, ".") < 0)
- return (CVS_EX_PROTO);
- if (cvs_sendln(root, root->cr_dir) < 0)
- return (CVS_EX_PROTO);
+ cvs_sendarg(root, co_mods[i], 0);
- if (cvs_sendreq(root, CVS_REQ_XPANDMOD, NULL) < 0)
- cvs_log(LP_ERR, "failed to expand module");
+ cvs_sendreq(root, CVS_REQ_DIRECTORY, ".");
+ cvs_sendln(root, root->cr_dir);
+ cvs_sendreq(root, CVS_REQ_XPANDMOD, NULL);
- if ((usehead == 1) && (cvs_sendarg(root, "-f", 0) < 0))
- return (CVS_EX_PROTO);
+ if (usehead == 1)
+ cvs_sendarg(root, "-f", 0);
- if ((tgtdir != NULL) &&
- ((cvs_sendarg(root, "-d", 0) < 0) ||
- (cvs_sendarg(root, tgtdir, 0) < 0)))
- return (CVS_EX_PROTO);
+ if (tgtdir != NULL) {
+ cvs_sendarg(root, "-d", 0);
+ cvs_sendarg(root, tgtdir, 0);
+ }
- if ((shorten == 0) && cvs_sendarg(root, "-N", 0) < 0)
- return (CVS_EX_PROTO);
+ if (shorten == 0)
+ cvs_sendarg(root, "-N", 0);
- if ((cvs_cmd_checkout.cmd_flags & CVS_CMD_PRUNEDIRS) &&
- (cvs_sendarg(root, "-P", 0) < 0))
- return (CVS_EX_PROTO);
+ if (cvs_cmd_checkout.cmd_flags & CVS_CMD_PRUNEDIRS);
+ cvs_sendarg(root, "-P", 0);
for (i = 0; i < co_nmod; i++)
- if (cvs_sendarg(root, co_mods[i], 0) < 0)
- return (CVS_EX_PROTO);
-
- if ((statmod == CVS_LISTMOD) &&
- (cvs_sendarg(root, "-c", 0) < 0))
- return (CVS_EX_PROTO);
- else if ((statmod == CVS_STATMOD) &&
- (cvs_sendarg(root, "-s", 0) < 0))
- return (CVS_EX_PROTO);
-
- if ((tag != NULL) && ((cvs_sendarg(root, "-r", 0) < 0) ||
- (cvs_sendarg(root, tag, 0) < 0)))
- return (CVS_EX_PROTO);
-
- if ((date != NULL) && ((cvs_sendarg(root, "-D", 0) < 0) ||
- (cvs_sendarg(root, date, 0) < 0)))
- return (CVS_EX_PROTO);
+ cvs_sendarg(root, co_mods[i], 0);
+
+ if (statmod == CVS_LISTMOD)
+ cvs_sendarg(root, "-c", 0);
+ else if (statmod == CVS_STATMOD)
+ cvs_sendarg(root, "-s", 0);
+
+ if (tag != NULL) {
+ cvs_sendarg(root, "-r", 0);
+ cvs_sendarg(root, tag, 0);
+ }
+
+ if (date != NULL) {
+ cvs_sendarg(root, "-D", 0);
+ cvs_sendarg(root, date, 0);
+ }
}
+
return (0);
}