From: Jakub Narębski Date: Tue, 06 Sep 2016 09:36:33 GMT Subject: Re: [PATCH v1 1/2] sha1_file: open window into packfiles with CLOEXEC Message-ID: In-Reply-To: <20160905222715.GA30031@starla> W dniu 06.09.2016 o 00:27, Eric Wong pisze: > larsxschneider@gmail.com wrote: >> -int git_open_noatime(const char *name) >> +int git_open_noatime_cloexec(const char *name) [...] > > I question the need for the "_cloexec" suffixing in the > function name since the old function is going away entirely. On the other hand the new name is descriptive... > > I prefer all FD-creating functions set cloexec by default > for FD > 2 to avoid inadvertantly leaking FDs. So we > ought to use pipe2, accept4, socket(..., SOCK_CLOEXEC), etc... > and fallback to the racy+slower F_SETFD when not available. > > > Fwiw, Perl has been setting cloexec on FDs above $^F > (2, $SYSTEM_FD_MAX) for decades, and Ruby started > doing it a few years ago, too.