mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-06 16:40:47 +00:00
daemon: fix recent style regressions
Re-wrap the read(2) line, and make the listen_child loop more explicit
in intent.
Reported by: kib
Fixes: 6ac7c9f06a
("daemon: remove redundant parameter from [...]")
This commit is contained in:
parent
99efa2c88d
commit
e064557916
|
@ -455,7 +455,9 @@ daemon_eventloop(struct daemon_state *state)
|
|||
/* child is dead, read all until EOF */
|
||||
state->pid = -1;
|
||||
state->mode = MODE_NOCHILD;
|
||||
while (listen_child(state));
|
||||
while (listen_child(state)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
case SIGTERM:
|
||||
|
@ -597,7 +599,8 @@ listen_child(struct daemon_state *state)
|
|||
assert(state != NULL);
|
||||
assert(state->pos < LBUF_SIZE - 1);
|
||||
|
||||
rv = read(state->pipe_rd, state->buf + state->pos, LBUF_SIZE - state->pos - 1);
|
||||
rv = read(state->pipe_rd, state->buf + state->pos,
|
||||
LBUF_SIZE - state->pos - 1);
|
||||
if (rv > 0) {
|
||||
state->pos += rv;
|
||||
assert(state->pos <= LBUF_SIZE - 1);
|
||||
|
|
Loading…
Reference in a new issue