summaryrefslogtreecommitdiff
path: root/src/libunixonacid/ipc_timed_send.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-02-17 22:30:53 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-02-17 22:30:53 +0000
commitfdffefb8032922ce7ffe4c00816072a8ff2148fc (patch)
treebc7313151a429c45d8bab8ad8b9dd32f4e51335f /src/libunixonacid/ipc_timed_send.c
parenta896ca2a8c617e5e00ffd5fc9e69331ad754e5b3 (diff)
downloadskalibs-fdffefb8032922ce7ffe4c00816072a8ff2148fc.tar.xz
More types changes
New disize Add size_t to the autotypes list Delete redundant and replace-libc files dev_t/ino_t pass Big size_t pass More things missing, still not operational yet
Diffstat (limited to 'src/libunixonacid/ipc_timed_send.c')
-rw-r--r--src/libunixonacid/ipc_timed_send.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libunixonacid/ipc_timed_send.c b/src/libunixonacid/ipc_timed_send.c
index 2129ec7..959c4bc 100644
--- a/src/libunixonacid/ipc_timed_send.c
+++ b/src/libunixonacid/ipc_timed_send.c
@@ -1,8 +1,6 @@
/* ISC license. */
- /* For OpenBSD, that still doesn't know what self-contained headers are */
#include <sys/types.h>
-
#include <sys/socket.h>
#include <errno.h>
#include <skalibs/error.h>
@@ -15,20 +13,20 @@
#define MSG_NOSIGNAL 0
#endif
-int ipc_timed_send (int fd, char const *s, unsigned int len, tain_t const *deadline, tain_t *stamp)
+int ipc_timed_send (int fd, char const *s, size_t len, tain_t const *deadline, tain_t *stamp)
{
iopause_fd x = { .fd = fd, .events = IOPAUSE_WRITE, .revents = 0 } ;
for (;;)
{
- register int r = iopause_stamp(&x, 1, deadline, stamp) ;
+ int r = iopause_stamp(&x, 1, deadline, stamp) ;
if (r < 0) return 0 ;
else if (!r) return (errno = ETIMEDOUT, 0) ;
else if (x.revents & IOPAUSE_WRITE)
{
- if (send(fd, s, len, MSG_NOSIGNAL) == (int)len) break ;
+ if (send(fd, s, len, MSG_NOSIGNAL) == (ssize_t)len) break ;
if (!error_isagain(errno)) return 0 ;
}
- else if (x.revents & IOPAUSE_EXCEPT) return (send(fd, s, len, MSG_NOSIGNAL) == (int)len) ;
+ else if (x.revents & IOPAUSE_EXCEPT) return (send(fd, s, len, MSG_NOSIGNAL) == (ssize_t)len) ;
}
return 1 ;
}