Correct the warning from ingoring write()'s error.
authorJon A. Cruz <jonc@osg.samsung.com>
Mon, 17 Aug 2015 23:11:48 +0000 (16:11 -0700)
committerJon A. Cruz <jonc@osg.samsung.com>
Wed, 19 Aug 2015 22:45:28 +0000 (22:45 +0000)
Change-Id: Iff2bf6ded384237bd63427f4602f0f31dac2d9d5
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2220
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
resource/csdk/connectivity/src/ip_adapter/caipserver.c

index 6ead6a4..75f8e50 100644 (file)
@@ -512,7 +512,15 @@ void CAWakeUpForChange()
 {
     if (caglobals.ip.shutdownFds[1] != -1)
     {
-        write(caglobals.ip.shutdownFds[1], "w", 1);
+        ssize_t len = 0;
+        do
+        {
+            len = write(caglobals.ip.shutdownFds[1], "w", 1);
+        } while ((len == -1) && (errno == EINTR));
+        if ((len == -1) && (errno != EINTR) && (errno != EPIPE))
+        {
+            OIC_LOG_V(DEBUG, TAG, "write failed: %s", strerror(errno));
+        }
     }
 }