[tor-commits] [tor/master] fix some warnings in compat_threads.c
nickm at torproject.org
nickm at torproject.org
Thu Jan 22 19:22:43 UTC 2015
commit 4a6b43bf76a993b0167f28f875cd4cf922daba71
Author: Nick Mathewson <nickm at torproject.org>
Date: Thu Jan 22 14:22:39 2015 -0500
fix some warnings in compat_threads.c
---
src/common/compat_threads.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/common/compat_threads.c b/src/common/compat_threads.c
index ba21c95..d2d929e 100644
--- a/src/common/compat_threads.c
+++ b/src/common/compat_threads.c
@@ -94,7 +94,7 @@ write_ni(int fd, const void *buf, size_t n)
{
int r;
again:
- r = write(fd, buf, n);
+ r = (int) write(fd, buf, n);
if (r < 0 && errno == EINTR)
goto again;
return r;
@@ -104,7 +104,7 @@ read_ni(int fd, void *buf, size_t n)
{
int r;
again:
- r = read(fd, buf, n);
+ r = (int) read(fd, buf, n);
if (r < 0 && errno == EINTR)
goto again;
return r;
@@ -117,7 +117,7 @@ send_ni(int fd, const void *buf, size_t n, int flags)
{
int r;
again:
- r = send(fd, buf, n, flags);
+ r = (int) send(fd, buf, n, flags);
if (r < 0 && errno == EINTR)
goto again;
return r;
@@ -128,7 +128,7 @@ recv_ni(int fd, void *buf, size_t n, int flags)
{
int r;
again:
- r = recv(fd, buf, n, flags);
+ r = (int) recv(fd, buf, n, flags);
if (r < 0 && errno == EINTR)
goto again;
return r;
@@ -160,7 +160,7 @@ eventfd_drain(int fd)
static int
pipe_alert(int fd)
{
- ssize_t r = write(fd, "x", 1);
+ ssize_t r = write_ni(fd, "x", 1);
if (r < 0 && errno != EAGAIN)
return -1;
return 0;
@@ -171,7 +171,7 @@ pipe_drain(int fd)
{
char buf[32];
ssize_t r;
- while ((r = read(fd, buf, sizeof(buf))) >= 0)
+ while ((r = read_ni(fd, buf, sizeof(buf))) >= 0)
;
if (r == 0 || errno != EAGAIN)
return -1;
More information about the tor-commits
mailing list