Re: latest clone/pull of git.git problems with setlinebuf.
- From
- Boyd Lynn Gerber <gerberb@zenez.com>
- Date
- Sep 4, 2008, 05:29 UTC
- Message-ID
- <alpine.LNX.1.10.0809032325080.25336@suse104.zenez.com>
- In-Reply-To
- <7vhc8w8rme.fsf@gitster.siamese.dyndns.org>
On Wed, 3 Sep 2008, Junio C Hamano wrote:
Show 21 quoted lines
> Boyd Lynn Gerber <gerberb@zenez.com> writes: >> On Wed, 3 Sep 2008, Junio C Hamano wrote: >>> 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. >> >> This fixes the problem. on both OS's. > > By the way, have you actually exercised the codepath, or does your above > "fixes" mean "compiles"? > > I knew it would compile on a system with POSIX setvbuf(), but I was > unsure about the size argument. I know for glibc giving <NULL, 0> would > be equivalent to setlinebuf(), but POSIX itself leaves what exactly > happens to the size argument quite vague, saying only "otherwise [when > buf is a null pointer], size may determine the size of a buffer > allocated by the setvbuf() function." Does size=0 mean it allocates > very little, and while it tries to line buffer the output, because the > buffer is so small that it fails to buffer an entire line causing early > flushing of the stream?
I only compiled it. I am debuging some test errors. I did a gmake test
This is the test that fails. Everything before it passes.
* ok 41: very long name in the index handled sanely * fixed 1 known breakage(s) * still have 1 known breakage(s) * passed all remaining 40 test(s) *** t0001-init.sh *** ... * ok 9: GIT_DIR & GIT_WORK_TREE (2) * FAIL 10: reinit
(
unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG mkdir again &&
cd again &&
git init >out1 2>err1 &&
git init >out2 2>err2
) &&
grep "Initialized empty" again/out1 &&
grep "Reinitialized existing" again/out2 &&
>again/empty &&
test_cmp again/empty again/err1 &&
test_cmp again/empty again/err2* FAIL 11: init with --template
mkdir template-source &&
echo content >template-source/file &&
(
mkdir template-custom &&
cd template-custom &&
git init --template=../template-source
) &&
test_cmp template-source/file template-custom/.git/file* ok 12: init with --template (blank) * failed 2 among 12 test(s) gmake[2]: *** [t0001-init.sh] Error 1
-- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047