From: Timo Sirainen Date: Tue, 31 May 2016 21:12:44 +0000 (+0300) Subject: lib: Fixed file_copy() after recent changes. X-Git-Tag: 2.3.0.rc1~3608 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0f56c2ae3318c2d0ccba824f7fa85c5e4a5d5e7c;p=thirdparty%2Fdovecot%2Fcore.git lib: Fixed file_copy() after recent changes. --- diff --git a/src/lib/file-copy.c b/src/lib/file-copy.c index 9e6058f1c7..99a5a55793 100644 --- a/src/lib/file-copy.c +++ b/src/lib/file-copy.c @@ -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: