summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/remove.c
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-04-12 14:58:41 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-04-12 14:58:41 +0000
commit4b03ee4a3e530b1453fb0907ac8166baf63bf053 (patch)
tree0dc798db78780d1cd2e362c04dbcd0e8f3ae7f47 /usr.bin/cvs/remove.c
parent77e328103b64f6514f65aa663caf3bee705dae4d (diff)
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/remove.c')
-rw-r--r--usr.bin/cvs/remove.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/cvs/remove.c b/usr.bin/cvs/remove.c
index 69c7358ef4e..7cb42b8144b 100644
--- a/usr.bin/cvs/remove.c
+++ b/usr.bin/cvs/remove.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: remove.c,v 1.6 2005/04/11 18:02:58 joris Exp $ */
+/* $OpenBSD: remove.c,v 1.7 2005/04/12 14:58:40 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* Copyright (c) 2004 Xavier Santolaria <xsa@openbsd.org>
@@ -73,7 +73,7 @@ cvs_remove_options(char *opt, int argc, char **argv, int *arg)
case 'R':
break;
default:
- return (1);
+ return (CVS_EX_USAGE);
}
}
@@ -81,7 +81,7 @@ cvs_remove_options(char *opt, int argc, char **argv, int *arg)
argv += optind;
if (argc == 0)
- return (1);
+ return (CVS_EX_USAGE);
*arg = optind;
return (0);
@@ -118,7 +118,7 @@ cvs_remove_file(CVSFILE *cf, void *arg)
entfile = cvs_ent_open(dirname(fpath), O_RDWR);
if (entfile == NULL) {
cvs_log(LP_ERR, "failed to remove `%s'", fpath);
- return (-1);
+ return (CVS_EX_FILE);
}
ent = cvs_ent_get(entfile, CVS_FILE_NAME(cf));
@@ -132,7 +132,7 @@ cvs_remove_file(CVSFILE *cf, void *arg)
if((unlink(fpath) == -1) && (errno != ENOENT)) {
cvs_log(LP_ERRNO, "failed to unlink `%s'",
fpath);
- return (-1);
+ return (CVS_EX_FILE);
}
}