summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjfb <jfb@openbsd.org>2004-08-10 14:23:57 +0000
committerjfb <jfb@openbsd.org>2004-08-10 14:23:57 +0000
commit6f9f47d3c15699c3d373764e44196e337bf4a68a (patch)
tree0d7ea649d53fbc5aee2b09fa39d02a2d36ad7415
parentGahhh, why is this still around? It was never necessary to inform the parent (diff)
downloadwireguard-openbsd-6f9f47d3c15699c3d373764e44196e337bf4a68a.tar.xz
wireguard-openbsd-6f9f47d3c15699c3d373764e44196e337bf4a68a.zip
Cleanup, and don't close the Entries file handle for a directory when we
are done loading its contents. We will need the file for whatever changes we bring to it
-rw-r--r--usr.bin/cvs/file.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c
index 9234343ebb0..0143e3a7657 100644
--- a/usr.bin/cvs/file.c
+++ b/usr.bin/cvs/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.24 2004/08/06 20:12:15 jfb Exp $ */
+/* $OpenBSD: file.c,v 1.25 2004/08/10 14:23:57 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -227,6 +227,7 @@ cvs_file_chkign(const char *file)
* cvs_file_create()
*
* Create a new file whose path is specified in <path> and of type <type>.
+ * Returns the created file on success, or NULL on failure.
*/
CVSFILE*
@@ -372,11 +373,6 @@ cvs_file_attach(CVSFILE *parent, CVSFILE *file)
dp = parent->cf_ddat;
- /* if the parent doesn't have an entry for that file, create it */
- if ((dp->cd_ent != NULL) &&
- ((ent = cvs_ent_get(dp->cd_ent, file->cf_name)) == NULL)) {
- }
-
TAILQ_INSERT_TAIL(&(dp->cd_files), file, cf_list);
dp->cd_nfiles++;
file->cf_parent = parent;
@@ -429,7 +425,7 @@ cvs_file_getdir(CVSFILE *cf, int flags)
}
}
- cdp->cd_ent = cvs_ent_open(cf->cf_path, O_RDONLY);
+ cdp->cd_ent = cvs_ent_open(cf->cf_path, O_RDWR);
}
fd = open(cf->cf_path, O_RDONLY);
@@ -477,12 +473,6 @@ cvs_file_getdir(CVSFILE *cf, int flags)
}
} while (ret > 0);
- /* we can now close our Entries file */
- if (cdp->cd_ent != NULL) {
- cvs_ent_close(cdp->cd_ent);
- cdp->cd_ent = NULL;
- }
-
if (flags & CF_SORT) {
cvs_file_sort(&(cdp->cd_files), cdp->cd_nfiles);
cvs_file_sort(&dirs, ndirs);