diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2006-04-11 08:07:36 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2006-04-11 08:07:36 +0000 |
commit | f67e000659450bee5b2961e27a367d60c51d7f1b (patch) | |
tree | 6bd5d58f0803b7348c7ebf00848692446f30b826 | |
parent | e2440a5fd61070583aa16b2ee475e8e036f1ce3c (diff) |
Don't rcs_close() before fatal(). After much hesitation, joris@
and xsa@ finally convinced me this is safe (and better).
OK joris@, niallo@, and xsa@.
-rw-r--r-- | usr.bin/rcs/rcsprog.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.bin/rcs/rcsprog.c b/usr.bin/rcs/rcsprog.c index a421be6ecc3..d69d6e9a433 100644 --- a/usr.bin/rcs/rcsprog.c +++ b/usr.bin/rcs/rcsprog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsprog.c,v 1.95 2006/04/10 08:08:00 xsa Exp $ */ +/* $OpenBSD: rcsprog.c,v 1.96 2006/04/11 08:07:35 ray Exp $ */ /* * Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -669,10 +669,8 @@ rcs_main(int argc, char **argv) /* Make sure revision exists. */ if (rcs_findrev(file, rev) == NULL) fatal("revision does not exist"); - if (rcs_lock_add(file, username, rev) == -1) { - rcs_close(file); + if (rcs_lock_add(file, username, rev) == -1) fatal("unable to lock file"); - } rcsnum_free(rev); } @@ -693,10 +691,8 @@ rcs_main(int argc, char **argv) /* Make sure revision exists. */ if (rcs_findrev(file, rev) == NULL) fatal("revision does not exist"); - if (rcs_lock_remove(file, username, rev) == -1) { - rcs_close(file); + if (rcs_lock_remove(file, username, rev) == -1) fatal("unable to unlock file"); - } rcsnum_free(rev); } |