summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/annotate.c
diff options
context:
space:
mode:
authorjoris <joris@openbsd.org>2005-04-12 14:58:40 +0000
committerjoris <joris@openbsd.org>2005-04-12 14:58:40 +0000
commit31274bbfeac0604f2d912b383d24f6fe4b3b2d03 (patch)
tree3dbb4fdcf02cf31da0d4788fd63e10814df86790 /usr.bin/cvs/annotate.c
parent* handle errors when loading delta branches (diff)
downloadwireguard-openbsd-31274bbfeac0604f2d912b383d24f6fe4b3b2d03.tar.xz
wireguard-openbsd-31274bbfeac0604f2d912b383d24f6fe4b3b2d03.zip
introduce our own set of error codes used by the commands to report
what exactly went wrong in case of an error. ok jfb@
Diffstat (limited to 'usr.bin/cvs/annotate.c')
-rw-r--r--usr.bin/cvs/annotate.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/cvs/annotate.c b/usr.bin/cvs/annotate.c
index da523cc2e2f..66c0322e78b 100644
--- a/usr.bin/cvs/annotate.c
+++ b/usr.bin/cvs/annotate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: annotate.c,v 1.8 2005/04/11 18:02:58 joris Exp $ */
+/* $OpenBSD: annotate.c,v 1.9 2005/04/12 14:58:40 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -85,14 +85,14 @@ cvs_annotate_options(char *opt, int argc, char **argv, int *arg)
rev = optarg;
break;
default:
- return (1);
+ return (CVS_EX_USAGE);
}
}
if ((date != NULL) && (rev != NULL)) {
cvs_log(LP_ERR,
"the -D and -d arguments are mutually exclusive");
- return (1);
+ return (CVS_EX_USAGE);
}
*arg = optind;
@@ -103,18 +103,18 @@ int
cvs_annotate_sendflags(struct cvsroot *root)
{
if (usehead && (cvs_sendarg(root, "-f", 0) < 0))
- return (-1);
+ return (CVS_EX_PROTO);
if (rev != NULL) {
if ((cvs_sendarg(root, "-r", 0) < 0) ||
(cvs_sendarg(root, rev, 0) < 0))
- return (-1);
+ return (CVS_EX_PROTO);
}
if (date != NULL) {
if ((cvs_sendarg(root, "-D", 0) < 0) ||
(cvs_sendarg(root, date, 0) < 0))
- return (-1);
+ return (CVS_EX_PROTO);
}
return (0);
@@ -154,7 +154,7 @@ cvs_annotate_file(CVSFILE *cf, void *arg)
if (root->cr_method != CVS_METHOD_LOCAL) {
if ((entp != NULL) && (cvs_sendentry(root, entp) < 0)) {
cvs_ent_free(entp);
- return (-1);
+ return (CVS_EX_PROTO);
}
switch (cf->cf_cvstat) {