[prev in list] [next in list] [prev in thread] [next in thread]
List: dovecot-cvs
Subject: dovecot-2.2: fs-posix: fs_read_stream() now returns an istream t...
From: dovecot () dovecot ! org (dovecot at dovecot ! org)
Date: 2014-09-24 23:55:52
Message-ID: hg.65963be31ceb.1411602952.6920021320469856403 () talvi
[Download RAW message or body]
details: http://hg.dovecot.org/dovecot-2.2/rev/65963be31ceb
changeset: 17834:65963be31ceb
user: Timo Sirainen <tss at iki.fi>
date: Thu Sep 25 02:55:34 2014 +0300
description:
fs-posix: fs_read_stream() now returns an istream that can live even after the fs_file is closed.
diffstat:
src/lib-fs/fs-posix.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diffs (18 lines):
diff -r 936435377584 -r 65963be31ceb src/lib-fs/fs-posix.c
--- a/src/lib-fs/fs-posix.c Thu Sep 25 01:13:12 2014 +0300
+++ b/src/lib-fs/fs-posix.c Thu Sep 25 02:55:34 2014 +0300
@@ -350,10 +350,11 @@
if (file->fd == -1 && fs_posix_open(file) < 0)
input = i_stream_create_error_str(errno, "%s", fs_last_error(_file->fs));
- else
- input = i_stream_create_fd(file->fd, max_buffer_size, FALSE);
+ else {
+ /* the stream could live even after the fs_file */
+ input = i_stream_create_fd_autoclose(&file->fd, max_buffer_size);
+ }
i_stream_set_name(input, _file->path);
- i_stream_add_destroy_callback(input, fs_posix_file_close, _file);
return input;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic