changeset 18310:08aa1949227b

fs-posix: Don't close file fd after its writing is finished. This allows reading the file after writing without having to re-open the file (which in turn might fail in some situations).
author Timo Sirainen <tss@iki.fi>
date Mon, 09 Mar 2015 15:26:45 +0200
parents 966680fbe2a9
children c28d8e2ae6a9
files src/lib-fs/fs-posix.c
diffstat 1 files changed, 0 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-fs/fs-posix.c	Mon Mar 09 15:26:01 2015 +0200
+++ b/src/lib-fs/fs-posix.c	Mon Mar 09 15:26:45 2015 +0200
@@ -393,14 +393,6 @@
 		}
 	}
 
-	if (close(file->fd) < 0) {
-		file->fd = -1;
-		fs_set_error(file->file.fs, "close(%s) failed: %m",
-			     file->full_path);
-		return -1;
-	}
-	file->fd = -1;
-
 	switch (file->open_mode) {
 	case FS_OPEN_MODE_CREATE_UNIQUE_128:
 	case FS_OPEN_MODE_CREATE: