]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/upload-archive.c
upload-archive: monitor child communication more carefully.
authorJunio C Hamano <junkio@cox.net>
Tue, 12 Sep 2006 07:26:57 +0000 (00:26 -0700)
committerJunio C Hamano <junkio@cox.net>
Wed, 13 Sep 2006 05:39:45 +0000 (22:39 -0700)
commitd3788e19e20cd14aeac99d1f294d9a368437284f
tree2c5f1aa4dcd80d48e027287d8c19c0b0d211e3b2
parent23d6d112c004d4242f9dbd8161f79ccdeb47bde8
upload-archive: monitor child communication more carefully.

Franck noticed that the code around polling and relaying messages
from the child process was quite bogus.  Here is an attempt to
clean it up a bit, based on his patch:

 - When POLLHUP is set, it goes ahead and reads the file
   descriptor.  Worse yet, it does not check the return value of
   read() for errors when it does.

 - When we processed one POLLIN, we should just go back and see
   if any more data is available.  We can check if the child is
   still there when poll gave control back at us but without any
   actual input.

[jc: with simplification suggested by Franck. ]

Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-upload-archive.c