From: Sunwook Bae Date: Thu, 1 Aug 2013 01:33:19 +0000 (+0900) Subject: Add to check the exception X-Git-Tag: accepted/tizen/20131007.232058~1^2~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fframework%2Fnative%2Fchannel-service.git;a=commitdiff_plain;h=5c3a7e21052ea135a71d29cd658d0c9d064ba7f2 Add to check the exception Change-Id: I96e392bd193b3e01958e2b3488ae084c9c1795eb Signed-off-by: Sunwook Bae --- diff --git a/src/IpcServer.cpp b/src/IpcServer.cpp index aacdd49..93074cf 100644 --- a/src/IpcServer.cpp +++ b/src/IpcServer.cpp @@ -303,6 +303,7 @@ IpcServer::OnConnectionRequest(GIOChannel* source, GIOCondition condition, gpoin _ChannelInfo* pChannelInfo = null; GSource* pGSource = null; GIOChannel* pChannel = null; + ssize_t readBytes = 0; int server = -1; int client = -1; @@ -317,7 +318,9 @@ IpcServer::OnConnectionRequest(GIOChannel* source, GIOCondition condition, gpoin client = accept(server, (struct sockaddr*) &clientAddress, &clientLen); SysTryCatch(NID_IO, client != -1, , E_SYSTEM, "[E_SYSTEM] Accept failed."); - read(client, &helloMessage, sizeof(helloMessage)); + readBytes = read(client, &helloMessage, sizeof(helloMessage)); + SysTryCatch(NID_IO, readBytes >= 0, , E_SYSTEM, "[E_SYSTEM] Failed to receive hello message (%d, %s).", + errno, strerror(errno)); pChannel = g_io_channel_unix_new(client); SysTryCatch(NID_IO, pChannel != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Not enough memory.");