diff options
author | Niall O'Higgins <niallo@cvs.openbsd.org> | 2006-03-16 23:53:28 +0000 |
---|---|---|
committer | Niall O'Higgins <niallo@cvs.openbsd.org> | 2006-03-16 23:53:28 +0000 |
commit | a127a85467532e9a62e1e5be032db5eb766450d0 (patch) | |
tree | 69e132c539f838057d1f85a96a6ea0f72f4923a9 /usr.bin | |
parent | 87bd71f1403a132531a781564d569ff1a47f6bc2 (diff) |
- checkout_rev() can fail, in which case we want a non-zero exit code.
ok joris@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/rcs/co.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/rcs/co.c b/usr.bin/rcs/co.c index 8f132a70505..0d00aa31ba1 100644 --- a/usr.bin/rcs/co.c +++ b/usr.bin/rcs/co.c @@ -1,4 +1,4 @@ -/* $OpenBSD: co.c,v 1.63 2006/03/16 17:11:30 xsa Exp $ */ +/* $OpenBSD: co.c,v 1.64 2006/03/16 23:53:27 niallo Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -36,7 +36,7 @@ static void checkout_err_nobranch(RCSFILE *, const char *, const char *, int checkout_main(int argc, char **argv) { - int i, ch, flags, kflag; + int i, ch, flags, kflag, status; RCSNUM *frev, *rev; RCSFILE *file; char fpath[MAXPATHLEN]; @@ -44,7 +44,7 @@ checkout_main(int argc, char **argv) const char *state; time_t rcs_mtime = -1; - flags = 0; + flags = status = 0; kflag = RCS_KWEXP_ERR; rev = RCS_HEAD_REV; frev = NULL; @@ -174,8 +174,8 @@ checkout_main(int argc, char **argv) else frev = rev; - if (checkout_rev(file, frev, argv[i], flags, - username, author, state, date) < 0) { + if ((status = checkout_rev(file, frev, argv[i], flags, + username, author, state, date)) < 0) { rcs_close(file); continue; } @@ -192,7 +192,7 @@ checkout_main(int argc, char **argv) if (rev != RCS_HEAD_REV) rcsnum_free(frev); - return (0); + return (status); } void |