Skip to content

Commit

Permalink
fs-posix: Minor code cleanup - removed unnecessary code.
Browse files Browse the repository at this point in the history
If success==TRUE, temp_path==NULL always also.
  • Loading branch information
sirainen authored and GitLab committed Apr 25, 2016
1 parent b540a53 commit 23e079a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/lib-fs/fs-posix.c
Expand Up @@ -47,7 +47,6 @@ struct posix_fs_file {
buffer_t *write_buf;

bool seek_to_beginning;
bool success;
};

struct posix_fs_lock {
Expand Down Expand Up @@ -345,7 +344,7 @@ static void fs_posix_file_deinit(struct fs_file *_file)
case FS_OPEN_MODE_CREATE_UNIQUE_128:
case FS_OPEN_MODE_CREATE:
case FS_OPEN_MODE_REPLACE:
if (file->success || file->temp_path == NULL)
if (file->temp_path == NULL)
break;
/* failed to create/replace this. delete the temp file */
if (unlink(file->temp_path) < 0) {
Expand Down Expand Up @@ -470,7 +469,6 @@ static int fs_posix_write_finish(struct posix_fs_file *file)
i_unreached();
}
i_free_and_null(file->temp_path);
file->success = TRUE;
file->seek_to_beginning = TRUE;
/* allow opening the file after writing to it */
file->open_mode = FS_OPEN_MODE_READONLY;
Expand Down

0 comments on commit 23e079a

Please sign in to comment.