From: Steffen Prohaska Date: Tue, 26 Aug 2014 15:23:24 +0000 (+0200) Subject: copy_fd(): do not close the input file descriptor X-Git-Tag: v2.2.0-rc0~61^2~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/b29763aa9bcbb99a59aec3820e30ff1864cfa765?hp=b29763aa9bcbb99a59aec3820e30ff1864cfa765 copy_fd(): do not close the input file descriptor The caller, not this function, opened the file descriptor; it is selfish for the callee to close it when it is done reading from it. The caller may want an option to rewind and re-read the contents after it returns. Simplify the loop to copy the input in full to the output; its body essentially is what a call to write_in_full() helper does. Signed-off-by: Steffen Prohaska Helped-by: Jeff King Signed-off-by: Junio C Hamano ---