From 49cb17940e403431566dc7b5a312624f14eb25d0 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 23 Jan 2015 23:47:14 +0000 Subject: Added fdholder, beta. Documentation will come next. --- src/libs6/s6_fdholder_setdump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libs6') diff --git a/src/libs6/s6_fdholder_setdump.c b/src/libs6/s6_fdholder_setdump.c index 61c238c..b6fb7c4 100644 --- a/src/libs6/s6_fdholder_setdump.c +++ b/src/libs6/s6_fdholder_setdump.c @@ -30,7 +30,7 @@ int s6_fdholder_setdump (s6_fdholder_t *a, s6_fdholder_fd_t const *list, unsigne if (!m.len || m.nfds) { unixmessage_drop(&m) ; return (errno = EPROTO, 0) ; } if (m.s[0]) return (errno = m.s[0], 0) ; if (m.len != 5) return (errno = EPROTO, 0) ; - uint32_unpack_big(pack + 1, &trips) ; + uint32_unpack_big(m.s + 1, &trips) ; if (trips != 1 + (ntot-1) / UNIXMESSAGE_MAXFDS) return (errno = EPROTO, 0) ; } for (i = 0 ; i < trips ; i++, ntot -= UNIXMESSAGE_MAXFDS) @@ -49,9 +49,9 @@ int s6_fdholder_setdump (s6_fdholder_t *a, s6_fdholder_fd_t const *list, unsigne v[1 + (j<<1)].s = pack + j * (TAIN_PACK+1) ; v[1 + (j<<1)].len = TAIN_PACK + 1 ; tain_pack(pack + j * (TAIN_PACK+1), &list->limit) ; - pack[j * (TAIN_PACK+1) + TAIN_PACK] = (unsigned char)len + 1 ; + pack[j * (TAIN_PACK+1) + TAIN_PACK] = (unsigned char)len ; v[2 + (j<<1)].s = (char *)list->id ; - v[2 + (j<<1)].len = len ; + v[2 + (j<<1)].len = len + 1 ; fds[j] = list->fd ; } if (!unixmessage_putv(&a->connection.out, &m)) return 0 ; -- cgit v1.2.3