dovecot-2.2: lib-fs: Removed redundant o_stream_nfinish() calls

dovecot at dovecot.org dovecot at dovecot.org
Wed Jun 17 09:24:56 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/343602625064
changeset: 18874:343602625064
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jun 17 12:22:17 2015 +0300
description:
lib-fs: Removed redundant o_stream_nfinish() calls

diffstat:

 src/lib-fs/fs-posix.c      |  10 ----------
 src/lib-fs/fs-randomfail.c |   6 ------
 src/lib-fs/fs-sis.c        |   2 --
 3 files changed, 0 insertions(+), 18 deletions(-)

diffs (62 lines):

diff -r 21c0ffec1d2b -r 343602625064 src/lib-fs/fs-posix.c
--- a/src/lib-fs/fs-posix.c	Wed Jun 17 12:21:52 2015 +0300
+++ b/src/lib-fs/fs-posix.c	Wed Jun 17 12:22:17 2015 +0300
@@ -47,7 +47,6 @@
 
 	bool seek_to_beginning;
 	bool success;
-	bool open_failed;
 };
 
 struct posix_fs_lock {
@@ -475,7 +474,6 @@
 	} else if (file->fd == -1 && fs_posix_open(file) < 0) {
 		_file->output = o_stream_create_error_str(errno, "%s",
 			fs_file_last_error(_file));
-		file->open_failed = TRUE;
 	} else {
 		_file->output = o_stream_create_fd_file(file->fd,
 							(uoff_t)-1, FALSE);
@@ -488,14 +486,6 @@
 	struct posix_fs_file *file = (struct posix_fs_file *)_file;
 	int ret = success ? 0 : -1;
 
-	if (file->open_failed)
-		ret = -1;
-	else if (o_stream_nfinish(_file->output) < 0) {
-		fs_set_error(_file->fs, "write(%s) failed: %s",
-			     o_stream_get_name(_file->output),
-			     o_stream_get_error(_file->output));
-		ret = -1;
-	}
 	o_stream_destroy(&_file->output);
 
 	switch (file->open_mode) {
diff -r 21c0ffec1d2b -r 343602625064 src/lib-fs/fs-randomfail.c
--- a/src/lib-fs/fs-randomfail.c	Wed Jun 17 12:21:52 2015 +0300
+++ b/src/lib-fs/fs-randomfail.c	Wed Jun 17 12:22:17 2015 +0300
@@ -382,12 +382,6 @@
 	struct randomfail_fs_file *file = (struct randomfail_fs_file *)_file;
 
 	if (_file->output != NULL) {
-		if (o_stream_nfinish(_file->output) < 0) {
-			fs_set_error(_file->fs, "write(%s) failed: %s",
-				     o_stream_get_name(_file->output),
-				     o_stream_get_error(_file->output));
-			success = FALSE;
-		}
 		if (_file->output == file->super_output)
 			_file->output = NULL;
 		else
diff -r 21c0ffec1d2b -r 343602625064 src/lib-fs/fs-sis.c
--- a/src/lib-fs/fs-sis.c	Wed Jun 17 12:21:52 2015 +0300
+++ b/src/lib-fs/fs-sis.c	Wed Jun 17 12:22:17 2015 +0300
@@ -375,8 +375,6 @@
 {
 	struct sis_fs_file *file = (struct sis_fs_file *)_file;
 
-	if (o_stream_nfinish(_file->output) < 0)
-		success = FALSE;
 	if (!success) {
 		if (file->super != NULL) {
 			fs_write_stream_abort(file->super, &file->fs_output);


More information about the dovecot-cvs mailing list