diff options
author | Michael Koch <konqueror@gmx.de> | 2003-10-21 14:49:40 +0000 |
---|---|---|
committer | Michael Koch <konqueror@gmx.de> | 2003-10-21 14:49:40 +0000 |
commit | 59164ec1979edcb50f758c3545c70d5f9c872c01 (patch) | |
tree | b5e8aa1eda20fcb685d9c87a4175d36117438625 /native/target | |
parent | 0058f09204e612cb54c1536a302d087e99336740 (diff) | |
download | classpath-59164ec1979edcb50f758c3545c70d5f9c872c01.tar.gz |
2003-10-21 Michael Koch <konqueror@gmx.de>
* native/target/generic/target_generic_file.h
(TARGET_NATIVE_OPEN_FILE): Set close-on-exec flag.
* native/target/generic/target_generic_network.h
(TARGET_NATIVE_NETWORK_SOCKET_OPEN_STREAM): Set close-on-exec flag.
(TARGET_NATIVE_NETWORK_SOCKET_OPEN_DATAGRAM): Likewise.
Diffstat (limited to 'native/target')
-rw-r--r-- | native/target/generic/target_generic_file.h | 1 | ||||
-rw-r--r-- | native/target/generic/target_generic_network.h | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/native/target/generic/target_generic_file.h b/native/target/generic/target_generic_file.h index 7dba5712f..344f793ab 100644 --- a/native/target/generic/target_generic_file.h +++ b/native/target/generic/target_generic_file.h @@ -141,6 +141,7 @@ extern "C" { flags, \ permissions \ ); \ + fcntl (filedescriptor,F_SETFD,FD_CLOEXEC); \ result=(filedescriptor>=0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \ } while (0) #endif diff --git a/native/target/generic/target_generic_network.h b/native/target/generic/target_generic_network.h index b59f50228..3b8c7d9e6 100644 --- a/native/target/generic/target_generic_network.h +++ b/native/target/generic/target_generic_network.h @@ -222,9 +222,11 @@ Systems : all #ifndef TARGET_NATIVE_NETWORK_SOCKET_OPEN_STREAM #include <sys/types.h> #include <sys/socket.h> + #include <fcntl.h> #define TARGET_NATIVE_NETWORK_SOCKET_OPEN_STREAM(socketDescriptor,result) \ do { \ socketDescriptor=socket(AF_INET,SOCK_STREAM,0); \ + fcntl(socketDescriptor,F_SETFD,FD_CLOEXEC); \ result=(socketDescriptor!=-1)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \ } while (0) #endif @@ -244,9 +246,11 @@ Systems : all #ifndef TARGET_NATIVE_NETWORK_SOCKET_OPEN_DATAGRAM #include <sys/types.h> #include <sys/socket.h> + #include <fcntl.h> #define TARGET_NATIVE_NETWORK_SOCKET_OPEN_DATAGRAM(socketDescriptor,result) \ do { \ socketDescriptor=socket(AF_INET,SOCK_DGRAM,0); \ + fcntl(socketDescriptor,F_SETFD,FD_CLOEXEC); \ result=(socketDescriptor!=-1)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \ } while (0) #endif |