summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2007-01-23 16:42:20 +0000
committerJoris Vink <joris@cvs.openbsd.org>2007-01-23 16:42:20 +0000
commite0753a1efc1700957dff874d51078176c5a1bc17 (patch)
tree36a135a84a5d8b6281e3736b943c7ce44027404f
parenta13ce43621ad860799738615a63d20a3ae49acd3 (diff)
When acting as a server do not blindly remove
directories in cvs_update_leavedir(). fixes the "Device busy" error some people have been seeing. problem initially reported by Frank Denis. ok xsa@
-rw-r--r--usr.bin/cvs/update.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/usr.bin/cvs/update.c b/usr.bin/cvs/update.c
index 43496486478..381af43a804 100644
--- a/usr.bin/cvs/update.c
+++ b/usr.bin/cvs/update.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: update.c,v 1.87 2007/01/18 09:26:19 xsa Exp $ */
+/* $OpenBSD: update.c,v 1.88 2007/01/23 16:42:19 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -186,11 +186,6 @@ cvs_update_leavedir(struct cvs_file *cf)
cvs_log(LP_TRACE, "cvs_update_leavedir(%s)", cf->file_path);
- if (cvs_server_active == 1) {
- cvs_rmdir(cf->file_path);
- return;
- }
-
if (cvs_cmdop == CVS_OP_EXPORT) {
export = xmalloc(MAXPATHLEN);
if (cvs_path_cat(cf->file_path, CVS_PATH_CVSDIR, export,
@@ -267,9 +262,11 @@ cvs_update_leavedir(struct cvs_file *cf)
/* XXX */
cvs_rmdir(cf->file_path);
- entlist = cvs_ent_open(cf->file_wd);
- cvs_ent_remove(entlist, cf->file_name);
- cvs_ent_close(entlist, ENT_SYNC);
+ if (cvs_server_active == 0) {
+ entlist = cvs_ent_open(cf->file_wd);
+ cvs_ent_remove(entlist, cf->file_name);
+ cvs_ent_close(entlist, ENT_SYNC);
+ }
}
}