<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello!<br>
<br>
We can not get the tests to pass with this patch.<br>
can you rerun the test at your side and verify that they all pass?<br>
<br>
Thank you<br>
<br>
On 12/06/2011 07:51 AM, Jovi Zhang wrote:
<blockquote
cite="mid:CACV3sbK5-dgAH=CA6KEohHf3OrcFB9peBr2j5H71LOvyHd+9dg@mail.gmail.com"
type="cite">
<pre wrap="">>From 501b8f4ab78c752ff11a794984aad547b8717c5f Mon Sep 17 00:00:00 2001
From: Jovi Zhang <a class="moz-txt-link-rfc2396E" href="mailto:bookjovi@gmail.com"><bookjovi@gmail.com></a>
Date: Tue, 29 Nov 2011 02:11:01 +0800
Subject: [PATCH] erts: fix error logic in efile_sendfile
This commit fix two errors in efile_sendfile(linux env):
1) when *nbytes is 0, we should invoke sendfile with count *nbytes,
not SENDFILE_CHUNK_SIZE
2) "while (retval != -1 && retval == SENDFILE_CHUNK_SIZE)" is pointless,
replace it by "while (retval == SENDFILE_CHUNK_SIZE)"
---
erts/emulator/drivers/unix/unix_efile.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/erts/emulator/drivers/unix/unix_efile.c
b/erts/emulator/drivers/unix/unix_efile.c
index eb2c5f5..fe0a0e2 100644
--- a/erts/emulator/drivers/unix/unix_efile.c
+++ b/erts/emulator/drivers/unix/unix_efile.c
@@ -1492,7 +1492,7 @@ efile_sendfile(Efile_error* errInfo, int in_fd,
int out_fd,
ssize_t retval;
do {
// check if *nbytes is 0 or greater than the largest size_t
- if (*nbytes == 0 || *nbytes > SENDFILE_CHUNK_SIZE)
+ if (*nbytes > SENDFILE_CHUNK_SIZE)
retval = sendfile(out_fd, in_fd, offset, SENDFILE_CHUNK_SIZE);
else
retval = sendfile(out_fd, in_fd, offset, *nbytes);
@@ -1500,7 +1500,7 @@ efile_sendfile(Efile_error* errInfo, int in_fd,
int out_fd,
written += retval;
*nbytes -= retval;
}
- } while (retval != -1 && retval == SENDFILE_CHUNK_SIZE);
+ } while (retval == SENDFILE_CHUNK_SIZE);
*nbytes = written;
return check_error(retval == -1 ? -1 : 0, errInfo);
#elif defined(DARWIN)
--
1.7.2.3</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-patches mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-patches@erlang.org">erlang-patches@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-patches">http://erlang.org/mailman/listinfo/erlang-patches</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
/Henrik Nord Erlang/OTP</pre>
</body>
</html>