From c49d803fb9746aa417943627a463de2db2c639ed Mon Sep 17 00:00:00 2001 From: Frank Lahm Date: Tue, 10 Jul 2012 14:47:41 +0200 Subject: [PATCH] Fix a Solaris 10 SPARC sendfilev bug --- NEWS | 4 ++++ libatalk/dsi/dsi_stream.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 31d47954..440ccdc0 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +Changes in 3.0.1 +================ +* FIX: afpd: Fix a Solaris 10 SPARC sendfilev bug + Changes in 3.0 ============== * UPD: afpd: force read only mode if cnid scheme is last diff --git a/libatalk/dsi/dsi_stream.c b/libatalk/dsi/dsi_stream.c index 97eb8ad7..98c9396f 100644 --- a/libatalk/dsi/dsi_stream.c +++ b/libatalk/dsi/dsi_stream.c @@ -364,7 +364,9 @@ ssize_t dsi_stream_read_file(DSI *dsi, const int fromfd, off_t offset, const siz sfvcnt = 2; vec[0].sfv_fd = SFV_FD_SELF; vec[0].sfv_flag = 0; - vec[0].sfv_off = block; + /* Cast to unsigned long to prevent sign extension of the + * pointer value for the LFS case; see Apache PR 39463. */ + vec[0].sfv_off = (unsigned long)block; vec[0].sfv_len = DSI_BLOCKSIZ; vec[1].sfv_fd = fromfd; vec[1].sfv_flag = 0; -- 2.39.2