summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/release.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/release.c
parentb7f424bf063934bb2d18aaa8573e5c818abcd8e7 (diff)
correct wrong error code usage.
ok jfb@, xsa@
Diffstat (limited to 'usr.bin/cvs/release.c')
-rw-r--r--usr.bin/cvs/release.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/cvs/release.c b/usr.bin/cvs/release.c
index ddecdec9e1d..ce6ee75b0ef 100644
--- a/usr.bin/cvs/release.c
+++ b/usr.bin/cvs/release.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: release.c,v 1.5 2005/05/19 22:07:33 jfb Exp $ */
+/* $OpenBSD: release.c,v 1.6 2005/05/20 20:00:53 joris Exp $ */
/*
* Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org>
* All rights reserved.
@@ -145,7 +145,7 @@ cvs_release_dir(CVSFILE *cdir, void *arg)
if (l == -1 || l >= (int)sizeof(cdpath)) {
errno = ENAMETOOLONG;
cvs_log(LP_ERRNO, "%s", cdpath);
- return (-1);
+ return (CVS_EX_DATA);
}
if (cdir->cf_type == DT_DIR) {
@@ -170,20 +170,20 @@ cvs_release_dir(CVSFILE *cdir, void *arg)
if (chdir(dpath) == -1) {
cvs_log(LP_ERRNO, "cannot change to dir `%s'",
dpath);
- return (-1);
+ return (CVS_EX_FILE);
}
/* construct `cvs update' command */
l = snprintf(updcmd, sizeof(updcmd), "%s %s %s update",
__progname, UPDCMD_FLAGS, root->cr_str);
if (l == -1 || l >= (int)sizeof(updcmd))
- return (-1);
+ return (CVS_EX_DATA);
/* XXX we should try to avoid a new connection ... */
if ((fp = popen(updcmd, "r")) == NULL) {
cvs_log(LP_ERROR, "cannot run command `%s'",
updcmd);
- return (-1);
+ return (CVS_EX_DATA);
}
while (fgets(buf, sizeof(buf), fp) != NULL) {
@@ -195,7 +195,7 @@ cvs_release_dir(CVSFILE *cdir, void *arg)
if (pclose(fp) != 0) {
cvs_log(LP_ERROR, "unable to release `%s'",
dpath);
- return (-1);
+ return (CVS_EX_DATA);
}
printf("You have [%d] altered file%s in this "
@@ -216,7 +216,7 @@ cvs_release_dir(CVSFILE *cdir, void *arg)
if (chdir(wdir) == -1) {
cvs_log(LP_ERRNO, "cannot change to original "
"working dir `%s'", wdir);
- return (-1);
+ return (CVS_EX_FILE);
}
if (dflag == 1) {
@@ -224,13 +224,13 @@ cvs_release_dir(CVSFILE *cdir, void *arg)
cvs_log(LP_ERRNO,
"deletion of directory `%s' failed",
dpath);
- return (-1);
+ return (CVS_EX_FILE);
}
}
}
} else {
cvs_log(LP_ERR, "no such directory: %s", dpath);
- return (-1);
+ return (CVS_EX_DATA);
}
return (0);