diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2008-03-01 14:40:24 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2008-03-01 14:40:24 +0000 |
commit | 7728c3d9c82ca53416fbcee881e9dc06f707982f (patch) | |
tree | ee8b6b7a905b0772bbd59819b6c8ae0fa1c0652a /usr.bin/cvs | |
parent | 5872abd6ee7e55c95d50f667fa775d2fcc717d0a (diff) |
when reopening the file pass the proper mode and reopen it using
O_RDWR instead of O_WRONLY so that when we are in server mode
we do not screw up in cvs_remote_send_file().
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/diff3.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/cvs/diff3.c b/usr.bin/cvs/diff3.c index 34f375eddcd..adfb540da98 100644 --- a/usr.bin/cvs/diff3.c +++ b/usr.bin/cvs/diff3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff3.c,v 1.44 2008/02/29 21:43:57 joris Exp $ */ +/* $OpenBSD: diff3.c,v 1.45 2008/03/01 14:40:23 joris Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -72,7 +72,7 @@ static const char copyright[] = #ifndef lint static const char rcsid[] = - "$OpenBSD: diff3.c,v 1.44 2008/02/29 21:43:57 joris Exp $"; + "$OpenBSD: diff3.c,v 1.45 2008/03/01 14:40:23 joris Exp $"; #endif /* not lint */ #include <ctype.h> @@ -247,7 +247,7 @@ cvs_merge_file(struct cvs_file *cf, int verbose) } (void)close(cf->fd); - cf->fd = open(cf->file_path, O_CREAT | O_WRONLY | O_TRUNC); + cf->fd = open(cf->file_path, O_CREAT | O_RDWR | O_TRUNC, 0644); if (cf->fd == -1) { fatal("cvs_merge_file: failed to reopen fd for writing: %s", strerror(errno)); |