diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2016-02-06 10:34:18 +0100 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2016-02-06 10:34:18 +0100 |
commit | ea901e0854b29e1744ff55b225b190241ce3832c (patch) | |
tree | 773e52497ebbfd9a27a6a0d087417c971dc1b42e /ACE/ace | |
parent | 85bd06e3be12e85b616e36ed5ddd5647b51c2e07 (diff) | |
download | ATCD-ea901e0854b29e1744ff55b225b190241ce3832c.tar.gz |
Check return value of ACE_OS::fcntl
* ACE/ace/Dev_Poll_Reactor.cpp:
* ACE/ace/Select_Reactor_Base.cpp:
Diffstat (limited to 'ACE/ace')
-rw-r--r-- | ACE/ace/Dev_Poll_Reactor.cpp | 10 | ||||
-rw-r--r-- | ACE/ace/Select_Reactor_Base.cpp | 11 |
2 files changed, 17 insertions, 4 deletions
diff --git a/ACE/ace/Dev_Poll_Reactor.cpp b/ACE/ace/Dev_Poll_Reactor.cpp index 475ffdd576a..8d2abc60ef8 100644 --- a/ACE/ace/Dev_Poll_Reactor.cpp +++ b/ACE/ace/Dev_Poll_Reactor.cpp @@ -78,8 +78,14 @@ ACE_Dev_Poll_Reactor_Notify::open (ACE_Reactor_Impl *r, #if defined (F_SETFD) // close-on-exec - ACE_OS::fcntl (this->notification_pipe_.read_handle (), F_SETFD, 1); - ACE_OS::fcntl (this->notification_pipe_.write_handle (), F_SETFD, 1); + if (ACE_OS::fcntl (this->notification_pipe_.read_handle (), F_SETFD, 1) == -1) + { + return -1; + } + if (ACE_OS::fcntl (this->notification_pipe_.write_handle (), F_SETFD, 1) == -1) + { + return -1; + } #endif /* F_SETFD */ #if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) diff --git a/ACE/ace/Select_Reactor_Base.cpp b/ACE/ace/Select_Reactor_Base.cpp index d007fe56e37..e48e2b2d3e3 100644 --- a/ACE/ace/Select_Reactor_Base.cpp +++ b/ACE/ace/Select_Reactor_Base.cpp @@ -611,8 +611,15 @@ ACE_Select_Reactor_Notify::open (ACE_Reactor_Impl *r, if (this->notification_pipe_.open () == -1) return -1; #if defined (F_SETFD) - ACE_OS::fcntl (this->notification_pipe_.read_handle (), F_SETFD, 1); - ACE_OS::fcntl (this->notification_pipe_.write_handle (), F_SETFD, 1); + if (ACE_OS::fcntl (this->notification_pipe_.read_handle (), F_SETFD, 1) == -1) + { + return -1; + } + + if (ACE_OS::fcntl (this->notification_pipe_.write_handle (), F_SETFD, 1) == -1) + { + return -1; + } #endif /* F_SETFD */ #if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) |