summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/soc_u.cpp
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-05-25 20:34:09 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-05-29 22:59:29 +0200
commitb1503b202043a577720e28969b74cca6f9c954f8 (patch)
tree7da9cdd46c0cde990c30c11570882efdca9396c6 /src/core/hle/service/soc_u.cpp
parentMerge pull request #817 from linkmauve/citra.ico (diff)
downloadyuzu-b1503b202043a577720e28969b74cca6f9c954f8.tar
yuzu-b1503b202043a577720e28969b74cca6f9c954f8.tar.gz
yuzu-b1503b202043a577720e28969b74cca6f9c954f8.tar.bz2
yuzu-b1503b202043a577720e28969b74cca6f9c954f8.tar.lz
yuzu-b1503b202043a577720e28969b74cca6f9c954f8.tar.xz
yuzu-b1503b202043a577720e28969b74cca6f9c954f8.tar.zst
yuzu-b1503b202043a577720e28969b74cca6f9c954f8.zip
Diffstat (limited to 'src/core/hle/service/soc_u.cpp')
-rw-r--r--src/core/hle/service/soc_u.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp
index 39b8d65fd..1e0f5df9b 100644
--- a/src/core/hle/service/soc_u.cpp
+++ b/src/core/hle/service/soc_u.cpp
@@ -139,7 +139,7 @@ static int TranslateError(int error) {
auto found = error_map.find(error);
if (found != error_map.end())
return -found->second;
-
+
return error;
}
@@ -346,7 +346,7 @@ static void Bind(Service::Interface* self) {
sockaddr sock_addr = CTRSockAddr::ToPlatform(*ctr_sock_addr);
int res = ::bind(socket_handle, &sock_addr, std::max<u32>(sizeof(sock_addr), len));
-
+
int result = 0;
if (res != 0)
result = TranslateError(GET_ERRNO);
@@ -360,14 +360,14 @@ static void Fcntl(Service::Interface* self) {
u32 socket_handle = cmd_buffer[1];
u32 ctr_cmd = cmd_buffer[2];
u32 ctr_arg = cmd_buffer[3];
-
+
int result = 0;
u32 posix_ret = 0; // TODO: Check what hardware returns for F_SETFL (unspecified by POSIX)
SCOPE_EXIT({
cmd_buffer[1] = result;
cmd_buffer[2] = posix_ret;
});
-
+
if (ctr_cmd == 3) { // F_GETFL
#if EMU_PLATFORM == PLATFORM_WINDOWS
posix_ret = 0;
@@ -404,11 +404,11 @@ static void Fcntl(Service::Interface* self) {
posix_ret = -1;
return;
}
-
+
flags &= ~O_NONBLOCK;
if (ctr_arg & 4) // O_NONBLOCK
flags |= O_NONBLOCK;
-
+
int ret = ::fcntl(socket_handle, F_SETFL, flags);
if (ret == SOCKET_ERROR_VALUE) {
result = TranslateError(GET_ERRNO);
@@ -439,8 +439,8 @@ static void Listen(Service::Interface* self) {
}
static void Accept(Service::Interface* self) {
- // TODO(Subv): Calling this function on a blocking socket will block the emu thread,
- // preventing graceful shutdown when closing the emulator, this can be fixed by always
+ // TODO(Subv): Calling this function on a blocking socket will block the emu thread,
+ // preventing graceful shutdown when closing the emulator, this can be fixed by always
// performing nonblocking operations and spinlock until the data is available
u32* cmd_buffer = Kernel::GetCommandBuffer();
u32 socket_handle = cmd_buffer[1];
@@ -448,7 +448,7 @@ static void Accept(Service::Interface* self) {
sockaddr addr;
socklen_t addr_len = sizeof(addr);
u32 ret = static_cast<u32>(::accept(socket_handle, &addr, &addr_len));
-
+
if ((s32)ret != SOCKET_ERROR_VALUE)
open_sockets[ret] = { ret, true };
@@ -525,8 +525,8 @@ static void SendTo(Service::Interface* self) {
}
static void RecvFrom(Service::Interface* self) {
- // TODO(Subv): Calling this function on a blocking socket will block the emu thread,
- // preventing graceful shutdown when closing the emulator, this can be fixed by always
+ // TODO(Subv): Calling this function on a blocking socket will block the emu thread,
+ // preventing graceful shutdown when closing the emulator, this can be fixed by always
// performing nonblocking operations and spinlock until the data is available
u32* cmd_buffer = Kernel::GetCommandBuffer();
u32 socket_handle = cmd_buffer[1];
@@ -568,7 +568,7 @@ static void Poll(Service::Interface* self) {
pollfd* platform_pollfd = new pollfd[nfds];
for (unsigned current_fds = 0; current_fds < nfds; ++current_fds)
platform_pollfd[current_fds] = CTRPollFD::ToPlatform(input_fds[current_fds]);
-
+
int ret = ::poll(platform_pollfd, nfds, timeout);
// Now update the output pollfd structure
@@ -630,7 +630,7 @@ static void GetPeerName(Service::Interface* self) {
socklen_t len = cmd_buffer[2];
CTRSockAddr* ctr_dest_addr = reinterpret_cast<CTRSockAddr*>(Memory::GetPointer(cmd_buffer[0x104 >> 2]));
-
+
sockaddr dest_addr;
socklen_t dest_addr_len = sizeof(dest_addr);
int ret = ::getpeername(socket_handle, &dest_addr, &dest_addr_len);
@@ -651,8 +651,8 @@ static void GetPeerName(Service::Interface* self) {
}
static void Connect(Service::Interface* self) {
- // TODO(Subv): Calling this function on a blocking socket will block the emu thread,
- // preventing graceful shutdown when closing the emulator, this can be fixed by always
+ // TODO(Subv): Calling this function on a blocking socket will block the emu thread,
+ // preventing graceful shutdown when closing the emulator, this can be fixed by always
// performing nonblocking operations and spinlock until the data is available
u32* cmd_buffer = Kernel::GetCommandBuffer();
u32 socket_handle = cmd_buffer[1];