Change-Id: I2f956c7d2874e19117d6c512d1372489053faec7
Signed-off-by: Hyunbin Lee <hyunbin.lee@samsung.com>
}
ret = fcntl(client, F_SETFL, flags);
}
ret = fcntl(client, F_SETFL, flags);
- SysTryCatch(NID_IO, ret >= 0 , r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Failed to set file status flags (%d, %s).",
+ SysTryCatch(NID_IO, ret >= 0, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Failed to set file status flags (%d, %s).",
errno, strerror(errno));
ret = write(client, &helloMessage, sizeof(helloMessage));
errno, strerror(errno));
ret = write(client, &helloMessage, sizeof(helloMessage));
+ SysTryCatch(NID_IO, ret >= 0, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Failed to send hello message (%d, %s).",
+ errno, strerror(errno));
#include <unistd.h>
#include <new>
#include <unique_ptr.h>
#include <unistd.h>
#include <new>
#include <unique_ptr.h>
+#include <string.h>
+#include <errno.h>
#include <FBaseInteger.h>
#include <FBaseDouble.h>
#include <FBaseInteger.h>
#include <FBaseDouble.h>
#include <FBase_StringConverter.h>
#include <FBase_LocalizedNumParser.h>
#include <FBase_StringConverter.h>
#include <FBase_LocalizedNumParser.h>
+#include <FBase_NativeError.h>
#include <FApp_AppInfo.h>
#include "FIo_FileImpl.h"
#include "FIo_NormalRegistry.h"
#include <FApp_AppInfo.h>
#include "FIo_FileImpl.h"
#include "FIo_NormalRegistry.h"
{
unique_ptr<char[]> pFilePath(_StringConverter::CopyToCharArrayN(_regPath));
int res = truncate(pFilePath.get(), 0);
{
unique_ptr<char[]> pFilePath(_StringConverter::CopyToCharArrayN(_regPath));
int res = truncate(pFilePath.get(), 0);
+ SysTryReturnResult(NID_IO, res == 0, __ConvertNativeErrorToResult(errno),
+ "Failed to truncate. errno: %d (%s)", errno, strerror(errno));
_ChannelInfo* pChannelInfo = null;
GSource* pGSource = null;
GIOChannel* pChannel = null;
_ChannelInfo* pChannelInfo = null;
GSource* pGSource = null;
GIOChannel* pChannel = null;
int server = -1;
int client = -1;
int server = -1;
int client = -1;
client = accept(server, (struct sockaddr*) &clientAddress, &clientLen);
SysTryCatch(NID_IO, client != -1, , E_SYSTEM, "[E_SYSTEM] Accept failed.");
client = accept(server, (struct sockaddr*) &clientAddress, &clientLen);
SysTryCatch(NID_IO, client != -1, , E_SYSTEM, "[E_SYSTEM] Accept failed.");
- res = 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));
helloMessage.appId[255] = '\0';
pChannel = g_io_channel_unix_new(client);
helloMessage.appId[255] = '\0';
pChannel = g_io_channel_unix_new(client);