aboutsummaryrefslogtreecommitdiffhomepage
path: root/fish.cpp
diff options
context:
space:
mode:
authorGravatar Peter Ammon <corydoras@ridiculousfish.com>2012-03-02 00:27:40 -0800
committerGravatar Peter Ammon <corydoras@ridiculousfish.com>2012-03-02 00:27:40 -0800
commit8b26d0104c1d85c271e5ce6e08bfe64a779beba7 (patch)
tree995568526f190084fd12d74bc6dcd0e828b1018a /fish.cpp
parent36622c35781c3212c2102c45781a496f3e1b3659 (diff)
Some initial changes to use CLO_EXEC, with an eye towards some day using it correctly.
Diffstat (limited to 'fish.cpp')
-rw-r--r--fish.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/fish.cpp b/fish.cpp
index 12011651..6bfd37ca 100644
--- a/fish.cpp
+++ b/fish.cpp
@@ -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;