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");