Some initial changes to use CLO_EXEC, with an eye towards some day using it correctly.

This commit is contained in:
Peter Ammon
2012-03-02 00:27:40 -08:00
parent 36622c3578
commit 8b26d0104c
19 changed files with 356 additions and 280 deletions

View File

@@ -326,13 +326,17 @@ int main( int argc, char **argv )
int i;
int fd;
wchar_t *rel_filename, *abs_filename;
if( ( fd = open(file, O_RDONLY) ) == -1 )
{
wperror( L"open" );
return 1;
}
// OK to not do this atomically since we cannot have gone multithreaded yet
set_cloexec(fd);
if( *(argv+my_optind))
{
wcstring sb;