]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-fs: Removed redundant o_stream_nfinish() calls
authorTimo Sirainen <tss@iki.fi>
Wed, 17 Jun 2015 09:22:17 +0000 (12:22 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 17 Jun 2015 09:22:17 +0000 (12:22 +0300)
src/lib-fs/fs-posix.c
src/lib-fs/fs-randomfail.c
src/lib-fs/fs-sis.c

index ee2ce0a4d70aec4bd1d5b6d61b4edf596c6efd4a..d8b39ee8910ffa01752416f6ad47729046c76eb0 100644 (file)
@@ -47,7 +47,6 @@ struct posix_fs_file {
 
        bool seek_to_beginning;
        bool success;
-       bool open_failed;
 };
 
 struct posix_fs_lock {
@@ -475,7 +474,6 @@ static void fs_posix_write_stream(struct fs_file *_file)
        } 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 @@ static int fs_posix_write_stream_finish(struct fs_file *_file, bool success)
        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) {
index c721c818f46ef4b5553ef72cfa90d683a7537b97..c7ae8972eeb8b8fc1b1145c828d3c130d588d35f 100644 (file)
@@ -382,12 +382,6 @@ static int fs_randomfail_write_stream_finish(struct fs_file *_file, bool success
        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
index ef754db32cf5983b90147b451139903b69283b42..cf975dadc89a339e376d56a91076ff45f3c4167e 100644 (file)
@@ -375,8 +375,6 @@ static int fs_sis_write_stream_finish(struct fs_file *_file, bool success)
 {
        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);