
Try to close as much as possible in jclose().
Thanks to Pieter Grimmerink for the suggestion.


---

 cur-root/trans.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff -puN trans.c~close_best_effort trans.c
--- cur/trans.c~close_best_effort	2004-07-28 23:48:54.000000000 -0300
+++ cur-root/trans.c	2004-08-28 21:22:24.232663720 -0300
@@ -606,20 +606,27 @@ exit:
 /* close a file */
 int jclose(struct jfs *fs)
 {
+	int ret;
+
+	ret = 0;
+	pthread_mutex_lock(&(fs->lock));
+
 	if (jsync(fs))
-		return -1;
+		ret = -1;
 	if (close(fs->fd))
-		return -1;
+		ret = -1;
 	if (close(fs->jfd))
-		return -1;
+		ret = -1;
 	if (close(fs->jdirfd))
-		return -1;
+		ret = -1;
 	if (fs->name)
 		/* allocated by strdup() in jopen() */
 		free(fs->name);
 	munmap(fs->jmap, sizeof(unsigned int));
+
+	pthread_mutex_unlock(&(fs->lock));
 	pthread_mutex_destroy(&(fs->lock));
 
-	return 0;
+	return ret;
 }
 
_
