[dovecot-cvs] dovecot/src/lib sendfile-util.c,1.9,1.10
cras at dovecot.org
cras at dovecot.org
Wed Sep 22 22:50:34 EEST 2004
Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv14074
Modified Files:
sendfile-util.c
Log Message:
Warning fix with Solaris.
Index: sendfile-util.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/sendfile-util.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- sendfile-util.c 22 May 2004 02:16:36 -0000 1.9
+++ sendfile-util.c 22 Sep 2004 19:50:32 -0000 1.10
@@ -89,13 +89,17 @@
ssize_t safe_sendfile(int out_fd, int in_fd, uoff_t *offset, size_t count)
{
ssize_t ret;
+ off_t s_offset;
i_assert(count <= SSIZE_T_MAX);
/* NOTE: if outfd is not a socket, some Solaris versions will
kernel panic */
- ret = sendfile(out_fd, in_fd, offset, count);
+ s_offset = (off_t)*offset;
+ ret = sendfile(out_fd, in_fd, &s_offset, count);
+ *offset = (uoff_t)s_offset;
+
if (ret < 0 && errno == EAFNOSUPPORT) {
/* not supported, return Linux-like EINVAL so caller
sees only consistent errnos. */
More information about the dovecot-cvs
mailing list