diff options
author | 2006-04-11 08:07:35 +0000 | |
---|---|---|
committer | 2006-04-11 08:07:35 +0000 | |
commit | 49c4eaaf7cb92c300f6ca045e0a2485638337727 (patch) | |
tree | c455c9dfad0b2fc49f4e0841080859fa93c60b8a /usr.bin/rcs/rcsprog.c | |
parent | Don't close() before fatal(). (diff) | |
download | wireguard-openbsd-49c4eaaf7cb92c300f6ca045e0a2485638337727.tar.xz wireguard-openbsd-49c4eaaf7cb92c300f6ca045e0a2485638337727.zip |
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@.
Diffstat (limited to 'usr.bin/rcs/rcsprog.c')
-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); } |