diff options
author | Julien Chaffraix <julien.chaffraix@gmail.com> | 2011-04-12 00:00:47 -0700 |
---|---|---|
committer | Thorsten Behrens <tbehrens@novell.com> | 2011-04-14 12:27:53 +0200 |
commit | 0fbc03ec4e294eb4a7fd874984a16fced6cbdb03 (patch) | |
tree | 6210645f61edfdf2b92ec7dc3b53939804e5f7b8 | |
parent | d52aa20175cffb5b356c51c22d9d112b98dff600 (diff) |
Added handling for the write errors in receiveFdPipe.
Fixed a dead assignment in process.c reported by CLang++
-rw-r--r-- | sal/osl/unx/process.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sal/osl/unx/process.c b/sal/osl/unx/process.c index d16c025ddc36..0f48c48a2797 100644 --- a/sal/osl/unx/process.c +++ b/sal/osl/unx/process.c @@ -376,6 +376,16 @@ static oslSocket receiveFdPipe(int PipeFD) OSL_TRACE("receiveFdPipe : writing back %i",nRetCode); nRead=write(PipeFD,&nRetCode,sizeof(nRetCode)); + if ( nRead < 0 ) + { + OSL_TRACE("write failed (%s)", strerror(errno)); + } + else if ( nRead != sizeof(nRetCode) ) + { + // TODO: Handle this case. + OSL_TRACE("partial write: wrote %d out of %d)", nRead, sizeof(nRetCode)); + } + #if defined(IOCHANNEL_TRANSFER_BSD_RENO) free(cmptr); #endif |