about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/stdio/fclose.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/stdio/fclose.c b/src/stdio/fclose.c
index 839d88af..d687a877 100644
--- a/src/stdio/fclose.c
+++ b/src/stdio/fclose.c
@@ -9,7 +9,7 @@ int fclose(FILE *f)
 	int r;
 	int perm;
 	
-	FFINALLOCK(f);
+	FLOCK(f);
 
 	__unlist_locked_file(f);
 
@@ -26,6 +26,7 @@ int fclose(FILE *f)
 
 	if (f->getln_buf) free(f->getln_buf);
 	if (!perm) free(f);
-	
+	else FUNLOCK(f);
+
 	return r;
 }