summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Chaffraix <julien.chaffraix@gmail.com>2011-04-12 00:00:47 -0700
committerThorsten Behrens <tbehrens@novell.com>2011-04-14 12:27:53 +0200
commit7d0d1f658a970574c663c46459cd2520a8696e37 (patch)
tree4724111fd8535608c67e36d103b0a2617c41f227
parent7654c346ec58955e14253d13bf3bd9eb4ce4a3e6 (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.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sal/osl/unx/process.c b/sal/osl/unx/process.c
index d21b1b70b..b41301c9e 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