git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: latest clone/pull of git.git problems with setlinebuf.

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 4, 2008, 03:33 UTC
Message-ID
<7vljy88u0m.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LNX.1.10.0809031858570.12887@suse104.zenez.com>
Boyd Lynn Gerber <gerberb@zenez.com> writes:
Show 16 quoted lines
> Hello,
>
> I just noticed that setlinebuf is coming back as undefined when trying
> to build the lastest version.
>
> on UnixWare 7.1.4 I get
>
>     LINK git-var
>     CC daemon.o
> UX:acomp: WARNING: "daemon.c", line 485: end-of-loop code not reached
>     LINK git-daemon
> Undefined                       first referenced
> symbol                              in file
> setlinebuf                          daemon.o
> UX:ld: ERROR: Symbol referencing errors. No output written to git-daemon
> gmake: *** [git-daemon] Error 1

Ah, ok. I should have noticed that setlinebuf() was outside POSIX (it is not usable on older BSDs either).

Let's see if we can replace it with setvbuf() which is POSIX.
---
 daemon.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git c/daemon.c w/daemon.c
index 23278e2..7f2743a 100644
--- c/daemon.c
+++ w/daemon.c
@@ -1083,7 +1083,8 @@ int main(int argc, char **argv)
 		openlog("git-daemon", LOG_PID, LOG_DAEMON);
 		set_die_routine(daemon_die);
 	} else
-		setlinebuf(stderr); /* avoid splitting a message in the middle */
+		/* avoid splitting a message in the middle */
+		setvbuf(stderr, NULL, _IOLBF, 0);
 
 	if (inetd_mode && (group_name || user_name))
 		die("--user and --group are incompatible with --inetd");
Previous: Boyd Lynn GerberNext: Boyd Lynn Gerber
Message 5 of 9 in “latest clone/pull of git.git problems with setlinebuf.”
  1. Boyd Lynn GerberSep 4, 2008
  2. Boyd Lynn GerberSep 4, 2008
  3. Avery PennarunSep 4, 2008
  4. Boyd Lynn GerberSep 4, 2008
  5. Junio C HamanoSep 4, 2008
  6. Boyd Lynn GerberSep 4, 2008
  7. Junio C HamanoSep 4, 2008
  8. Boyd Lynn GerberSep 4, 2008
  9. Boyd Lynn GerberSep 4, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.