From 05fe914f6f78c8f7bb3f4530d68b2926bf2cea51 Mon Sep 17 00:00:00 2001 From: Jose Date: Thu, 27 Dec 2012 23:20:00 +0100 Subject: Fixed warnings related to ICE-5157 --- cpp/src/Ice/Service.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'cpp/src/Ice/Service.cpp') diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp index df2681fb02b..d5f77ada648 100644 --- a/cpp/src/Ice/Service.cpp +++ b/cpp/src/Ice/Service.cpp @@ -1709,15 +1709,33 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa int fd; fd = open("/dev/null", O_RDWR); assert(fd == 0); + if(fd != 0) + { + SyscallException ex(__FILE__, __LINE__); + ex.error = IceInternal::getSystemErrno(); + throw ex; + } if(stdOut.empty()) { fd = dup2(0, 1); assert(fd == 1); + if(fd != 1) + { + SyscallException ex(__FILE__, __LINE__); + ex.error = IceInternal::getSystemErrno(); + throw ex; + } } if(stdErr.empty()) { fd = dup2(1, 2); assert(fd == 2); + if(fd != 2) + { + SyscallException ex(__FILE__, __LINE__); + ex.error = IceInternal::getSystemErrno(); + throw ex; + } } } -- cgit v1.2.3