diff options
author | David Oberhollenzer <goliath@infraroot.at> | 2019-03-28 13:57:19 +0100 |
---|---|---|
committer | David Oberhollenzer <goliath@infraroot.at> | 2019-03-28 15:19:06 +0100 |
commit | 9e7478397a6f3c7bc38be52268e805d5b094eeb2 (patch) | |
tree | a2f625e00999aac9eaed6b1e095aa62fe950ee83 /lib/init/init_socket_recv_status.c | |
parent | c16735414ba63cb593881cd32e46dc086f003181 (diff) |
Include service ID in initsock status response
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
Diffstat (limited to 'lib/init/init_socket_recv_status.c')
-rw-r--r-- | lib/init/init_socket_recv_status.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/init/init_socket_recv_status.c b/lib/init/init_socket_recv_status.c index 95126e2..b812819 100644 --- a/lib/init/init_socket_recv_status.c +++ b/lib/init/init_socket_recv_status.c @@ -63,16 +63,19 @@ static char *read_string(int fd) int init_socket_recv_status(int fd, init_status_response_t *resp) { - uint8_t info[2]; + uint8_t info[8]; memset(resp, 0, sizeof(*resp)); - if (read_retry(fd, info, 2) <= 0) + if (read_retry(fd, info, sizeof(info)) <= 0) return -1; resp->state = info[0]; resp->exit_status = info[1]; + resp->id = ((int)info[4] << 24) | ((int)info[5] << 16) | + ((int)info[6] << 8) | (int)info[7]; + if (resp->state == ESS_NONE) return 0; |