summaryrefslogtreecommitdiff
path: root/src/libs6
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-01-23 23:47:14 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-01-23 23:47:14 +0000
commit49cb17940e403431566dc7b5a312624f14eb25d0 (patch)
tree2f85adb6b0083eec04cce56fd1954889adcdd478 /src/libs6
parente62d3ae45e9bf3b97551b8879bf6c441ff961ec1 (diff)
downloads6-49cb17940e403431566dc7b5a312624f14eb25d0.tar.xz
Added fdholder, beta. Documentation will come next.
Diffstat (limited to 'src/libs6')
-rw-r--r--src/libs6/s6_fdholder_setdump.c6
1 files changed, 3 insertions, 3 deletions
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 ;