diff options
Diffstat (limited to 'src/libunixonacid/unixmessage_receiver_free.c')
-rw-r--r-- | src/libunixonacid/unixmessage_receiver_free.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libunixonacid/unixmessage_receiver_free.c b/src/libunixonacid/unixmessage_receiver_free.c index d9d575e..776509c 100644 --- a/src/libunixonacid/unixmessage_receiver_free.c +++ b/src/libunixonacid/unixmessage_receiver_free.c @@ -1,5 +1,6 @@ /* ISC license. */ +#include <sys/types.h> #include <skalibs/cbuffer.h> #include <skalibs/stralloc.h> #include <skalibs/djbunix.h> @@ -7,19 +8,20 @@ void unixmessage_receiver_free (unixmessage_receiver_t *b) { - register unsigned int h = b->maindata.len ; + size_t maindatalen = b->maindata.len ; + int h ; b->fd = -1 ; stralloc_free(&b->maindata) ; - h = h != b->mainlen || b->auxdata.len != b->auxlen || cbuffer_len(&b->auxb) ; + h = maindatalen != b->mainlen || b->auxdata.len != b->auxlen || cbuffer_len(&b->auxb) ; if (h) { - register unsigned int n = b->auxdata.len / sizeof(int) ; + size_t n = b->auxdata.len / sizeof(int) ; while (n--) fd_close(((int *)b->auxdata.s)[n]) ; } stralloc_free(&b->auxdata) ; if (h) { - register unsigned int n = cbuffer_len(&b->auxb) / sizeof(int) ; + size_t n = cbuffer_len(&b->auxb) / sizeof(int) ; if (n) { int fds[n] ; |