summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/file.c
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2005-01-11 00:01:15 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2005-01-11 00:01:15 +0000
commit44101ba4b541339e5661d2ae9b8cffddc7defa82 (patch)
tree8c85963e01d645d6c6fe1463af4465227c49c701 /usr.bin/cvs/file.c
parentca6f4dedf7deebc0146f43142008b43fa50903a4 (diff)
Close the Entries file we just created upon directory creation. This
fixes the problem where a checkout would only add entries for directories. from Joris Vink
Diffstat (limited to 'usr.bin/cvs/file.c')
-rw-r--r--usr.bin/cvs/file.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c
index e4ef5a13ffd..788ede4afe9 100644
--- a/usr.bin/cvs/file.c
+++ b/usr.bin/cvs/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.49 2005/01/06 20:17:25 jfb Exp $ */
+/* $OpenBSD: file.c,v 1.50 2005/01/11 00:01:14 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -284,6 +284,10 @@ cvs_file_create(CVSFILE *parent, const char *path, u_int type, mode_t mode)
}
cfp->cf_ddat->cd_ent = cvs_ent_open(path, O_RDWR);
+ if (cfp->cf_ddat->cd_ent != NULL) {
+ cvs_ent_close(cfp->cf_ddat->cd_ent);
+ cfp->cf_ddat->cd_ent = NULL;
+ }
} else {
fd = open(path, O_WRONLY|O_CREAT|O_EXCL, mode);
if (fd == -1) {