aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat_threads.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-01-22 14:22:39 -0500
committerNick Mathewson <nickm@torproject.org>2015-01-22 14:22:39 -0500
commit4a6b43bf76a993b0167f28f875cd4cf922daba71 (patch)
tree317e4dc69b481c830b0dd7a6c80dafa2bf354390 /src/common/compat_threads.c
parent1fb9979eb8b4db7a32d311a9a7323a681b68ee14 (diff)
downloadtor-4a6b43bf76a993b0167f28f875cd4cf922daba71.tar.gz
tor-4a6b43bf76a993b0167f28f875cd4cf922daba71.zip
fix some warnings in compat_threads.c
Diffstat (limited to 'src/common/compat_threads.c')
-rw-r--r--src/common/compat_threads.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/compat_threads.c b/src/common/compat_threads.c
index ba21c951fa..d2d929e430 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;