diff options
author | Peter Ammon <corydoras@ridiculousfish.com> | 2012-03-02 00:27:40 -0800 |
---|---|---|
committer | Peter Ammon <corydoras@ridiculousfish.com> | 2012-03-02 00:27:40 -0800 |
commit | 8b26d0104c1d85c271e5ce6e08bfe64a779beba7 (patch) | |
tree | 995568526f190084fd12d74bc6dcd0e828b1018a /builtin.cpp | |
parent | 36622c35781c3212c2102c45781a496f3e1b3659 (diff) |
Some initial changes to use CLO_EXEC, with an eye towards some day using it correctly.
Diffstat (limited to 'builtin.cpp')
-rw-r--r-- | builtin.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin.cpp b/builtin.cpp index bdbf270f..d33b0864 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -2724,6 +2724,7 @@ static int builtin_contains( parser_t &parser, wchar_t ** argv ) */ static int builtin_source( parser_t &parser, wchar_t ** argv ) { + ASSERT_IS_MAIN_THREAD(); int fd; int res = STATUS_BUILTIN_OK; struct stat buf; @@ -2759,7 +2760,7 @@ static int builtin_source( parser_t &parser, wchar_t ** argv ) return STATUS_BUILTIN_ERROR; } - if( ( fd = wopen( argv[1], O_RDONLY ) ) == -1 ) + if( ( fd = wopen_cloexec( argv[1], O_RDONLY ) ) == -1 ) { append_format(stderr_buffer, _(L"%ls: Error encountered while sourcing file '%ls':\n"), argv[0], argv[1] ); builtin_wperror( L"." ); |