]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Fixed file_copy() after recent changes.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 31 May 2016 21:12:44 +0000 (00:12 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 31 May 2016 21:12:44 +0000 (00:12 +0300)
src/lib/file-copy.c

index 9e6058f1c7920ac31b5630d11c41fd37d8ccba57..99a5a55793a30b135dd0fe2145dc5fdb0eaaa92d 100644 (file)
@@ -18,7 +18,7 @@ static int file_copy_to_tmp(const char *srcpath, const char *tmppath,
        struct stat st;
        mode_t old_umask;
        int fd_in, fd_out;
-       off_t ret;
+       int ret = -1;
 
        if (try_hardlink) {
                /* see if hardlinking works */
@@ -72,6 +72,7 @@ static int file_copy_to_tmp(const char *srcpath, const char *tmppath,
 
        switch (o_stream_send_istream(output, input)) {
        case OSTREAM_SEND_ISTREAM_RESULT_FINISHED:
+               ret = 0;
                break;
        case OSTREAM_SEND_ISTREAM_RESULT_WAIT_INPUT:
        case OSTREAM_SEND_ISTREAM_RESULT_WAIT_OUTPUT: