summaryrefslogtreecommitdiff
path: root/usr.bin/rcs
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2007-09-09 17:01:39 +0000
committerRay Lai <ray@cvs.openbsd.org>2007-09-09 17:01:39 +0000
commit668fa0fbd75739816d01bfa9b7725bfb81516740 (patch)
tree46badce71fa2f5d1f6e6c168417103b1af67152a /usr.bin/rcs
parentdb0a8a77ed55dc3936f22e404c97f7fa57ea1b49 (diff)
Have rlog exit 1 if any of the files could not be opened.
Don't mention -q flag, which is there for compatibility. From Pierre Riteau. OK joris for first part, OK niallo and jmc for second.
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r--usr.bin/rcs/rlog.18
-rw-r--r--usr.bin/rcs/rlog.c15
2 files changed, 12 insertions, 11 deletions
diff --git a/usr.bin/rcs/rlog.1 b/usr.bin/rcs/rlog.1
index ce6fc9a742d..3fe19f6c741 100644
--- a/usr.bin/rcs/rlog.1
+++ b/usr.bin/rcs/rlog.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: rlog.1,v 1.21 2007/05/31 19:20:15 jmc Exp $
+.\" $OpenBSD: rlog.1,v 1.22 2007/09/09 17:01:38 ray Exp $
.\"
.\" Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org>
.\" All rights reserved.
@@ -14,7 +14,7 @@
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: September 9 2007 $
.Dt RLOG 1
.Os
.Sh NAME
@@ -22,7 +22,7 @@
.Nd display information about RCS files
.Sh SYNOPSIS
.Nm
-.Op Fl bhLNqRtV
+.Op Fl bhLNRtV
.Op Fl d Ns Ar dates
.Op Fl l Ns Op Ar lockers
.Op Fl r Ns Op Ar revs
@@ -93,8 +93,6 @@ If a comma-separated list of login names is specified,
ignore all locks other than those held in the list.
.It Fl N
Do not print symbolic names.
-.It Fl q
-Be quiet about reporting.
.It Fl R
Print name of RCS file only.
.It Fl r Ns Op Ar revs
diff --git a/usr.bin/rcs/rlog.c b/usr.bin/rcs/rlog.c
index 348eae8873c..4f3d0f35abc 100644
--- a/usr.bin/rcs/rlog.c
+++ b/usr.bin/rcs/rlog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rlog.c,v 1.58 2007/06/30 08:23:49 xsa Exp $ */
+/* $OpenBSD: rlog.c,v 1.59 2007/09/09 17:01:38 ray Exp $ */
/*
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
* Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org>
@@ -53,7 +53,7 @@ void
rlog_usage(void)
{
fprintf(stderr,
- "usage: rlog [-bhLNqRtV] [-ddates] [-l[lockers]] [-r[revs]]\n"
+ "usage: rlog [-bhLNRtV] [-ddates] [-l[lockers]] [-r[revs]]\n"
" [-sstates] [-w[logins]] [-xsuffixes]\n"
" [-ztz] file ...\n");
}
@@ -63,11 +63,11 @@ rlog_main(int argc, char **argv)
{
RCSFILE *file;
int Rflag;
- int i, ch, fd;
+ int i, ch, fd, status;
char fpath[MAXPATHLEN];
rcsnum_flags |= RCSNUM_NO_MAGIC;
- hflag = Rflag = rflag = 0;
+ hflag = Rflag = rflag = status = 0;
while ((ch = rcs_getopt(argc, argv, RLOG_OPTSTRING)) != -1) {
switch (ch) {
case 'h':
@@ -144,12 +144,15 @@ rlog_main(int argc, char **argv)
fd = rcs_choosefile(argv[i], fpath, sizeof(fpath));
if (fd < 0) {
warn("%s", fpath);
+ status = 1;
continue;
}
if ((file = rcs_open(fpath, fd,
- RCS_READ|RCS_PARSE_FULLY)) == NULL)
+ RCS_READ|RCS_PARSE_FULLY)) == NULL) {
+ status = 1;
continue;
+ }
if (Lflag == 1 && TAILQ_EMPTY(&(file->rf_locks))) {
rcs_close(file);
@@ -167,7 +170,7 @@ rlog_main(int argc, char **argv)
rcs_close(file);
}
- return (0);
+ return (status);
}
static void