summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/status.c
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-05-20 20:00:54 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-05-20 20:00:54 +0000
commit810674bc8d2f234cd5f3edf64762ce5bbbd9eb07 (patch)
tree9ea6c1f81ec8083ee94186ff4c3b762b7c35963d /usr.bin/cvs/status.c
parentb7f424bf063934bb2d18aaa8573e5c818abcd8e7 (diff)
correct wrong error code usage.
ok jfb@, xsa@
Diffstat (limited to 'usr.bin/cvs/status.c')
-rw-r--r--usr.bin/cvs/status.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/usr.bin/cvs/status.c b/usr.bin/cvs/status.c
index 1c60155302b..6c0cf14a37b 100644
--- a/usr.bin/cvs/status.c
+++ b/usr.bin/cvs/status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: status.c,v 1.20 2005/04/27 04:54:46 jfb Exp $ */
+/* $OpenBSD: status.c,v 1.21 2005/05/20 20:00:53 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -129,14 +129,17 @@ cvs_status_remote(CVSFILE *cfp, void *arg)
CVS_FILE_NAME(cfp));
else
ret = cvs_senddir(root, cfp);
+
+ if (ret == -1)
+ ret = CVS_EX_PROTO;
+
return (ret);
}
cvs_file_getpath(cfp, fpath, sizeof(fpath));
- if (cvs_sendentry(root, cfp) < 0) {
- return (-1);
- }
+ if (cvs_sendentry(root, cfp) < 0)
+ return (CVS_EX_PROTO);
switch (cfp->cf_cvstat) {
case CVS_FST_UNKNOWN:
@@ -154,6 +157,9 @@ cvs_status_remote(CVSFILE *cfp, void *arg)
break;
}
+ if (ret == -1)
+ ret = CVS_EX_PROTO;
+
return (ret);
}
@@ -183,13 +189,12 @@ cvs_status_local(CVSFILE *cfp, void *arg)
if (l == -1 || l >= (int)sizeof(rcspath)) {
errno = ENAMETOOLONG;
cvs_log(LP_ERRNO, "%s", rcspath);
- return (-1);
+ return (CVS_EX_DATA);
}
rf = rcs_open(rcspath, RCS_READ);
- if (rf == NULL) {
- return (-1);
- }
+ if (rf == NULL)
+ return (CVS_EX_DATA);
buf[0] = '\0';
if (cfp->cf_cvstat == CVS_FST_LOST)