From: Junio C Hamano Date: Thu, 08 Dec 2005 03:29:47 GMT Subject: Re: [PATCH] Clean up file descriptors when calling hooks. Message-ID: <7vr78omfkk.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <20051208032428.8591.qmail@science.horizon.com> linux@horizon.com writes: > E.g. imagine if I ran gcc -c file.c, and it assigned file.c to fd 0, > file.h to fd1, and file.o to fd 2. Then wants to print a warning > message... right into the middle of the binary. (Oversimplified > example, because gcc is actually several separate programs, but > hopefully you get the idea.) > > It's just safer to leave those fds open to a null device. Overdangerous example. Do people realize hooks run without any locking?