Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH nd/threaded-index-pack] index-pack: disable threading if NO_PREAD is defined

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:38

Johannes Sixt [off-list ref] writes:
quoted hunk
Am 4/19/2012 16:05, schrieb Nguyễn Thái Ngọc Duy:
quoted
NO_PREAD simulates pread() as a sequence of seek, read, seek in
compat/pread.c. The simulation is not thread-safe because another
thread could move the file offset away in the middle of pread
operation. Do not allow threading in that case.
Unsurprisingly, this fixes the breakage for me.

I used the attached patch to keep t9300 running when the breakage
was detected.
--- 8< ---
From: Johannes Sixt <redacted>
Subject: [PATCH] t9300-fast-import: avoid 'exit' in test_expect_success snippets

Exiting from a for-loop early using '|| break' does not propagate the
failure code, and for this reason, the tests used just 'exit'. But this
ends the test script with 'FATAL: Unexpected exit code 1' in the case of
a failed test.

Fix this by moving the loop into a shell function, from which we can
simply return early.
Makes sense.  If the original were written more readably, I may have
suggested to run the entire for loop in a subshell, but a helper
function is equally readable and with many identical checks, it is the
right way to do this.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help