summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/checkout.c
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2009-02-21 14:50:54 +0000
committerJoris Vink <joris@cvs.openbsd.org>2009-02-21 14:50:54 +0000
commitc2ba0921de160a4bb10293dfaa537f9f1e87d8ca (patch)
tree94065c663dd8c60e38a52969e46d77fc0db3133d /usr.bin/cvs/checkout.c
parent53146bfe603e5b82e27e15e3ce328636640a3298 (diff)
use FILE_ON_DISK flags when we need to verify if a file
exists in the working copy or not instead of checking fd being -1 since this can differ in server or local mode.
Diffstat (limited to 'usr.bin/cvs/checkout.c')
-rw-r--r--usr.bin/cvs/checkout.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/cvs/checkout.c b/usr.bin/cvs/checkout.c
index 98e51c08edb..61db978e3ef 100644
--- a/usr.bin/cvs/checkout.c
+++ b/usr.bin/cvs/checkout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: checkout.c,v 1.158 2009/02/21 13:44:18 joris Exp $ */
+/* $OpenBSD: checkout.c,v 1.159 2009/02/21 14:50:53 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -494,7 +494,7 @@ cvs_checkout_file(struct cvs_file *cf, RCSNUM *rnum, char *tag, int co_flags)
(void)unlink(cf->file_path);
if (!(co_flags & CO_MERGE)) {
- if (cf->fd != -1) {
+ if (cf->file_flags & FILE_ON_DISK) {
exists = 1;
(void)close(cf->fd);
}
@@ -506,6 +506,7 @@ cvs_checkout_file(struct cvs_file *cf, RCSNUM *rnum, char *tag, int co_flags)
strerror(errno));
rcs_rev_write_fd(cf->file_rcs, rnum, cf->fd, 0);
+ cf->file_flags |= FILE_ON_DISK;
} else {
cvs_merge_file(cf, (cvs_join_rev1 == NULL));
}