diff options
author | Ron Yorston <rmy@pobox.com> | 2016-05-25 08:58:07 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2016-05-25 08:58:07 +0100 |
commit | 204f9419baa815d3030ea618ddde5d05525c6c6c (patch) | |
tree | 01708b4a9c1fcee6e48dfb5545f38d96ef999f88 | |
parent | 7ff0648275a752db9ab33c2e1708e475b5831675 (diff) | |
download | busybox-w32-204f9419baa815d3030ea618ddde5d05525c6c6c.tar.gz busybox-w32-204f9419baa815d3030ea618ddde5d05525c6c6c.tar.bz2 busybox-w32-204f9419baa815d3030ea618ddde5d05525c6c6c.zip |
win32: correct cast of argument to _open_osfhandle
-rw-r--r-- | win32/net.c | 4 | ||||
-rw-r--r-- | win32/popen.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/win32/net.c b/win32/net.c index 05df6d20e..2341119b0 100644 --- a/win32/net.c +++ b/win32/net.c | |||
@@ -37,7 +37,7 @@ int mingw_socket(int domain, int type, int protocol) | |||
37 | return -1; | 37 | return -1; |
38 | } | 38 | } |
39 | /* convert into a file descriptor */ | 39 | /* convert into a file descriptor */ |
40 | if ((sockfd = _open_osfhandle(s, O_RDWR|O_BINARY)) < 0) { | 40 | if ((sockfd = _open_osfhandle((intptr_t)s, O_RDWR|O_BINARY)) < 0) { |
41 | closesocket(s); | 41 | closesocket(s); |
42 | bb_error_msg("unable to make a socket file descriptor: %s", | 42 | bb_error_msg("unable to make a socket file descriptor: %s", |
43 | strerror(errno)); | 43 | strerror(errno)); |
@@ -90,7 +90,7 @@ int mingw_accept(int sockfd1, struct sockaddr *sa, socklen_t *sz) | |||
90 | SOCKET s2 = accept(s1, sa, sz); | 90 | SOCKET s2 = accept(s1, sa, sz); |
91 | 91 | ||
92 | /* convert into a file descriptor */ | 92 | /* convert into a file descriptor */ |
93 | if ((sockfd2 = _open_osfhandle(s2, O_RDWR|O_BINARY)) < 0) { | 93 | if ((sockfd2 = _open_osfhandle((intptr_t)s2, O_RDWR|O_BINARY)) < 0) { |
94 | int err = errno; | 94 | int err = errno; |
95 | closesocket(s2); | 95 | closesocket(s2); |
96 | bb_error_msg("unable to make a socket file descriptor: %s", | 96 | bb_error_msg("unable to make a socket file descriptor: %s", |
diff --git a/win32/popen.c b/win32/popen.c index 93d51bb55..6b8e52ca9 100644 --- a/win32/popen.c +++ b/win32/popen.c | |||
@@ -154,11 +154,11 @@ FILE *mingw_popen(const char *cmd, const char *mode) | |||
154 | p->pipe[ic] = INVALID_HANDLE_VALUE; | 154 | p->pipe[ic] = INVALID_HANDLE_VALUE; |
155 | 155 | ||
156 | if ( *mode == 'r' ) { | 156 | if ( *mode == 'r' ) { |
157 | fd = _open_osfhandle((long)p->pipe[ip], _O_RDONLY|_O_BINARY); | 157 | fd = _open_osfhandle((intptr_t)p->pipe[ip], _O_RDONLY|_O_BINARY); |
158 | fptr = _fdopen(fd, "rb"); | 158 | fptr = _fdopen(fd, "rb"); |
159 | } | 159 | } |
160 | else { | 160 | else { |
161 | fd = _open_osfhandle((long)p->pipe[ip], _O_WRONLY|_O_BINARY); | 161 | fd = _open_osfhandle((intptr_t)p->pipe[ip], _O_WRONLY|_O_BINARY); |
162 | fptr = _fdopen(fd, "wb"); | 162 | fptr = _fdopen(fd, "wb"); |
163 | } | 163 | } |
164 | 164 | ||
@@ -252,10 +252,10 @@ int mingw_popen_fd(const char *cmd, const char *mode, int fd0, pid_t *pid) | |||
252 | p->pipe[ic] = INVALID_HANDLE_VALUE; | 252 | p->pipe[ic] = INVALID_HANDLE_VALUE; |
253 | 253 | ||
254 | if ( *mode == 'r' ) { | 254 | if ( *mode == 'r' ) { |
255 | fd = _open_osfhandle((long)p->pipe[ip], _O_RDONLY|_O_BINARY); | 255 | fd = _open_osfhandle((intptr_t)p->pipe[ip], _O_RDONLY|_O_BINARY); |
256 | } | 256 | } |
257 | else { | 257 | else { |
258 | fd = _open_osfhandle((long)p->pipe[ip], _O_WRONLY|_O_BINARY); | 258 | fd = _open_osfhandle((intptr_t)p->pipe[ip], _O_WRONLY|_O_BINARY); |
259 | } | 259 | } |
260 | 260 | ||
261 | finito: | 261 | finito: |