summaryrefslogtreecommitdiff
path: root/usr.bin/rcs
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2006-05-08 09:59:10 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2006-05-08 09:59:10 +0000
commitbcf7d56f36b81c034316d13dae682715f0090d91 (patch)
tree445f1680776706b318862725cbf85512f3a8d1f4 /usr.bin/rcs
parentdd28ef8a71d1e784b07abb66ed629e05e1bc5334 (diff)
err() and errx() should also exit with status 2;
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r--usr.bin/rcs/rcsdiff.c16
-rw-r--r--usr.bin/rcs/rcsmerge.c6
2 files changed, 11 insertions, 11 deletions
diff --git a/usr.bin/rcs/rcsdiff.c b/usr.bin/rcs/rcsdiff.c
index e1ea2b0c338..fbaf74b2253 100644
--- a/usr.bin/rcs/rcsdiff.c
+++ b/usr.bin/rcs/rcsdiff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsdiff.c,v 1.62 2006/05/08 09:48:12 xsa Exp $ */
+/* $OpenBSD: rcsdiff.c,v 1.63 2006/05/08 09:59:09 xsa Exp $ */
/*
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
* All rights reserved.
@@ -48,14 +48,14 @@ rcsdiff_main(int argc, char **argv)
status = D_SAME;
if (strlcpy(diffargs, "diff", sizeof(diffargs)) >= sizeof(diffargs))
- errx(1, "diffargs too long");
+ errx(D_ERROR, "diffargs too long");
while ((ch = rcs_getopt(argc, argv, "ck:nqr:TuVx::z::")) != -1) {
switch (ch) {
case 'c':
if (strlcat(diffargs, " -c", sizeof(diffargs)) >=
sizeof(diffargs))
- errx(1, "diffargs too long");
+ errx(D_ERROR, "diffargs too long");
diff_format = D_CONTEXT;
break;
case 'k':
@@ -69,7 +69,7 @@ rcsdiff_main(int argc, char **argv)
case 'n':
if (strlcat(diffargs, " -n", sizeof(diffargs)) >=
sizeof(diffargs))
- errx(1, "diffargs too long");
+ errx(D_ERROR, "diffargs too long");
diff_format = D_RCSDIFF;
break;
case 'q':
@@ -86,7 +86,7 @@ rcsdiff_main(int argc, char **argv)
case 'u':
if (strlcat(diffargs, " -u", sizeof(diffargs)) >=
sizeof(diffargs))
- errx(1, "diffargs too long");
+ errx(D_ERROR, "diffargs too long");
diff_format = D_UNIFIED;
break;
case 'V':
@@ -128,11 +128,11 @@ rcsdiff_main(int argc, char **argv)
if (rev_str1 != NULL) {
if ((rev1 = rcs_getrevnum(rev_str1, file)) == NULL)
- errx(1, "bad revision number");
+ errx(D_ERROR, "bad revision number");
}
if (rev_str2 != NULL) {
if ((rev2 = rcs_getrevnum(rev_str2, file)) == NULL)
- errx(1, "bad revision number");
+ errx(D_ERROR, "bad revision number");
}
if (!(flags & QUIET)) {
@@ -223,7 +223,7 @@ rcsdiff_file(RCSFILE *file, RCSNUM *rev, const char *filename)
/* XXX - GNU uses GMT */
if (fstat(fd, &st) == -1)
- err(1, "%s", filename);
+ err(D_ERROR, "%s", filename);
tb = gmtime(&st.st_mtime);
t = mktime(tb);
diff --git a/usr.bin/rcs/rcsmerge.c b/usr.bin/rcs/rcsmerge.c
index f2bc54ae029..c99024cb4c9 100644
--- a/usr.bin/rcs/rcsmerge.c
+++ b/usr.bin/rcs/rcsmerge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsmerge.c,v 1.38 2006/05/08 09:48:12 xsa Exp $ */
+/* $OpenBSD: rcsmerge.c,v 1.39 2006/05/08 09:59:09 xsa Exp $ */
/*
* Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org>
* All rights reserved.
@@ -128,11 +128,11 @@ rcsmerge_main(int argc, char **argv)
rev1 = rcsnum_alloc();
rcsnum_cpy(file->rf_head, rev1, 0);
} else if ((rev1 = rcs_getrevnum(rev_str1, file)) == NULL)
- errx(1, "invalid revision: %s", rev_str1);
+ errx(D_ERROR, "invalid revision: %s", rev_str1);
if (rev_str2 != NULL && strcmp(rev_str2, "") != 0) {
if ((rev2 = rcs_getrevnum(rev_str2, file)) == NULL)
- errx(1, "invalid revision: %s", rev_str2);
+ errx(D_ERROR, "invalid revision: %s", rev_str2);
} else {
rev2 = rcsnum_alloc();
rcsnum_cpy(file->rf_head, rev2, 0);