}
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));
+ SysTryCatch(NID_IO, ret >= 0, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Failed to send hello message (%d, %s).",
+ errno, strerror(errno));
if (forReverse)
{
#include <unistd.h>
#include <new>
#include <unique_ptr.h>
+#include <string.h>
+#include <errno.h>
#include <FBaseInteger.h>
#include <FBaseDouble.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"
{
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));
return E_SUCCESS;
}
_ChannelInfo* pChannelInfo = null;
GSource* pGSource = null;
GIOChannel* pChannel = null;
- ssize_t res = 0;
+ ssize_t readBytes = 0;
int server = -1;
int client = -1;
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);