]> git.ipfire.org Git - thirdparty/git.git/commit - run-command.c
pipe_command(): handle ENOSPC when writing to a pipe
authorJeff King <peff@peff.net>
Wed, 17 Aug 2022 06:09:42 +0000 (02:09 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 17 Aug 2022 16:21:41 +0000 (09:21 -0700)
commitc6d3cce6f3c4d1a8d9ebc556c38f1335afdfeb6c
tree4964570102a4b0745a4ebd13a2bebbc7ca06244f
parent14eab817e499cb047dd8ba21e688257a06d043f0
pipe_command(): handle ENOSPC when writing to a pipe

When write() to a non-blocking pipe fails because the buffer is full,
POSIX says we should see EAGAIN. But our mingw_write() compat layer on
Windows actually returns ENOSPC for this case. This is probably
something we want to correct, but given that we don't plan to use
non-blocking descriptors in a lot of places, we can work around it by
just catching ENOSPC alongside EAGAIN. If we ever do fix mingw_write(),
then this patch can be reverted.

We don't actually use a non-blocking pipe yet, so this is still just
preparation.

Helped-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
run-command.c