Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Oct 2023 16:45:09 GMT
From:      Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= <des@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: cec8e6ba64cc - main - daemon: Disable stdio buffering.
Message-ID:  <202310061645.396Gj9PH026910@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by des:

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

commit cec8e6ba64ccab7fb0d9fa531ebad9228233334d
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2023-10-06 16:44:52 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2023-10-06 16:44:52 +0000

    daemon: Disable stdio buffering.
    
    The daemon utility already does its own buffering and retransmits its
    child's output line by line.  There's no need for stdio to add its own
    buffering on top of this.
    
    MFC after:      1 week
    Sponsored by:   Modirum MDPay
    Reviewed by:    allanjude
    Differential Revision:  https://reviews.freebsd.org/D42111
---
 usr.sbin/daemon/daemon.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c
index dfbb609ce10d..65e6bb7ca190 100644
--- a/usr.sbin/daemon/daemon.c
+++ b/usr.sbin/daemon/daemon.c
@@ -420,6 +420,7 @@ daemon_eventloop(struct daemon_state *state)
 	close(state->pipe_fd[1]);
 	state->pipe_fd[1] = -1;
 	setproctitle("%s[%d]", state->title, (int)state->pid);
+	setbuf(stdout, NULL);
 
 	while (state->mode != MODE_NOCHILD) {
 		ret = kevent(kq, NULL, 0, &event, 1, NULL);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202310061645.396Gj9PH026910>