mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-23 02:51:55 +00:00
transfused: use memcmp instead of a loop for checking init message
Signed-off-by: David Sheets <dsheets@docker.com>
This commit is contained in:
parent
9d5309953f
commit
58706fd84e
@ -938,10 +938,9 @@ void *init_thread(void *params_ptr)
|
||||
buf = must_malloc("incoming control message buffer", CTL_BUFSZ);
|
||||
|
||||
/* TODO: handle other messages */
|
||||
read_exactly("init thread", params->ctl_sock, buf, 6);
|
||||
for (int i = 0; i < sizeof(init_msg); i++)
|
||||
if (((char *)buf)[i] != init_msg[i])
|
||||
die(1, params, NULL, "init thread: unexpected message");
|
||||
read_exactly("init thread", params->ctl_sock, buf, sizeof(init_msg));
|
||||
if (memcmp(buf, init_msg, sizeof(init_msg)))
|
||||
die(1, params, NULL, "init thread: unexpected message");
|
||||
|
||||
/* we've gotten Continue so write the pidfile */
|
||||
if (params->pidfile != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user