The branch main has been updated by kevans:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=e064557916a905d0add20c4012cf3678131c11e7

commit e064557916a905d0add20c4012cf3678131c11e7
Author:     Kyle Evans <kev...@freebsd.org>
AuthorDate: 2023-12-27 16:08:28 +0000
Commit:     Kyle Evans <kev...@freebsd.org>
CommitDate: 2023-12-27 16:09:47 +0000

    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:  6ac7c9f06ae9 ("daemon: remove redundant parameter from [...]")
---
 usr.sbin/daemon/daemon.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c
index f349a382edd2..6cde194cf16e 100644
--- a/usr.sbin/daemon/daemon.c
+++ b/usr.sbin/daemon/daemon.c
@@ -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);

Reply via email to