dovecot-2.2: fs-posix: Don't close file fd after its writing is ...

dovecot at dovecot.org dovecot at dovecot.org
Mon Mar 9 13:42:58 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/08aa1949227b
changeset: 18310:08aa1949227b
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Mar 09 15:26:45 2015 +0200
description:
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).

diffstat:

 src/lib-fs/fs-posix.c |  8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

diffs (18 lines):

diff -r 966680fbe2a9 -r 08aa1949227b src/lib-fs/fs-posix.c
--- 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:


More information about the dovecot-cvs mailing list