summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/rcs.c
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-10-05 17:35:00 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-10-05 17:35:00 +0000
commitc5d24926a1f3365ba8d1cc1f9d15a4d1697a7228 (patch)
treec5a02ef033124ffd6d41a9460c9d724e5b7aba31 /usr.bin/cvs/rcs.c
parent61e444f728104a653b73be88df3c8692e9c54e90 (diff)
open the RCS file with O_TRUNC as well when
writing new contents to it;
Diffstat (limited to 'usr.bin/cvs/rcs.c')
-rw-r--r--usr.bin/cvs/rcs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c
index cb31fd19548..a04463c7624 100644
--- a/usr.bin/cvs/rcs.c
+++ b/usr.bin/cvs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.77 2005/10/05 11:38:02 joris Exp $ */
+/* $OpenBSD: rcs.c,v 1.78 2005/10/05 17:34:59 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -597,7 +597,7 @@ rcs_write(RCSFILE *rfp)
return (-1);
}
- if ((to_fd = open(rfp->rf_path, O_WRONLY|O_CREAT))
+ if ((to_fd = open(rfp->rf_path, O_WRONLY|O_TRUNC|O_CREAT))
== -1) {
cvs_log(LP_ERRNO, "failed to open `%s'", fn);
close(from_fd);