Merge "Fix a fd mis-match" into tizen_2.1
authorSunwook Bae <sunwook45.bae@samsung.com>
Wed, 22 May 2013 07:07:27 +0000 (16:07 +0900)
committerGerrit Code Review <gerrit2@kim11>
Wed, 22 May 2013 07:07:27 +0000 (16:07 +0900)
src/io/FIo_IpcClient.cpp
src/server/io/FIo_IpcServer.cpp

index 62a5957..6e1061f 100644 (file)
@@ -573,6 +573,8 @@ _IpcClient::SendSync(IPC::Message* pMessage)
                        }
 
                        SysLogException(NID_IO, E_SYSTEM, "[E_SYSTEM] Failed to poll (%d, %s).", errno, strerror(errno));
+
+                       ReleaseFd(fd);
                        return E_SYSTEM;
                }
 
@@ -598,7 +600,14 @@ _IpcClient::SendSync(IPC::Message* pMessage)
                if (pEndOfMessage)
                {
                        pReply = new (std::nothrow) IPC::Message(message.data(), pEndOfMessage - message.data());
-                       SysTryReturnResult(NID_IO, pReply != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
+                       if (pReply == null)
+                       {
+                               SysLogException(NID_IO, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+
+                               ReleaseFd(fd);
+                               return E_OUT_OF_MEMORY;
+                       }
+
                        break;
                }
        }
index a55ce49..eff2eae 100644 (file)
@@ -730,8 +730,6 @@ _IpcServer::SendResponse(int client, IPC::Message* pMessage)
                        SysTryCatch(NID_IO, ret != G_IO_STATUS_ERROR, , E_SYSTEM, "[E_SYSTEM] Error occurred during writing message to socket.");
                }
 
-               SysTryCatch(NID_IO, pGError == null, , E_SYSTEM, "[E_SYSTEM] Error occurred during writing message to socket.");
-
                remain -= written;
                pData += written;
        }
@@ -779,8 +777,6 @@ _IpcServer::SendResponse(int client, const IPC::Message& message)
                        SysTryCatch(NID_IO, ret != G_IO_STATUS_ERROR, , E_SYSTEM, "[E_SYSTEM] Error occurred during writing message to socket.");
                }
 
-               SysTryCatch(NID_IO, pGError == null, , E_SYSTEM, "[E_SYSTEM] Error occurred during writing message to socket.");
-
                remain -= written;
                pData += written;
        }