summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/rcs.h
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2010-10-31 15:37:35 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2010-10-31 15:37:35 +0000
commit8e4a343572aa68e38a3936eb72fc7c81f7e52797 (patch)
tree62e01f4d220ea1a10c080d590793b0a3b688d55f /usr.bin/cvs/rcs.h
parent45451c0cba4d5bcad865bc91daabf8783a94a81d (diff)
init was passing a writable file descriptor into rcs_open which was then
failing to fdopen() it as readable. It doesn't need to pass in the fd at all, so just change it to pass -1 which makes cvs init work again. In fact, the fd should never need to be writable - it is only used for reading. RCS_WRITE triggers a rewrite on the file on rcs_close() but this is done by using a temporary and rename(2) (RCS_WRITE is a poor name for the flag). So while here, add a couple of comments to hopefully make it a little clearer. There is some confusion about how this is used in other places but checking those is a separate issue. with and ok tobias
Diffstat (limited to 'usr.bin/cvs/rcs.h')
-rw-r--r--usr.bin/cvs/rcs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/cvs/rcs.h b/usr.bin/cvs/rcs.h
index 98b20eeae8a..a60a14996b2 100644
--- a/usr.bin/cvs/rcs.h
+++ b/usr.bin/cvs/rcs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.h,v 1.97 2010/10/20 19:53:53 tobias Exp $ */
+/* $OpenBSD: rcs.h,v 1.98 2010/10/31 15:37:34 nicm Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -106,7 +106,7 @@ struct rcs_kw {
/* file flags */
#define RCS_READ (1<<0)
-#define RCS_WRITE (1<<1)
+#define RCS_WRITE (1<<1) /* flush changes on rcs_close() */
#define RCS_CREATE (1<<2) /* create the file */
#define RCS_PARSE_FULLY (1<<3) /* fully parse it on open */