summaryrefslogtreecommitdiff
path: root/usr.bin/rcs/rlog.c
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/rlog.c
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/rlog.c')
-rw-r--r--usr.bin/rcs/rlog.c15
1 files changed, 9 insertions, 6 deletions
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