Skip to content

Commit

Permalink
fix: return value from PipeDevice::UpdateInput
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilNarayana committed Feb 10, 2024
1 parent c74ae82 commit b8ec612
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,11 @@ Core::DeviceRemoval PipeDevice::UpdateInput()
// Read any pending characters off the pipe. If we hit a newline,
// then dequeue a command off the front of m_buf and parse it.
char buf[32];
s32 bytes_read = readFromPipe(m_fd, buf, sizeof buf);
if (bytes_read == 0)
{
// Pipe died, so just quit out
return;
}
ssize_t bytes_read = read(m_fd, buf, sizeof buf);
while (bytes_read > 0)
{
m_buf.append(buf, bytes_read);
bytes_read = readFromPipe(m_fd, buf, sizeof buf);
bytes_read = read(m_fd, buf, sizeof buf);
}
std::size_t newline = m_buf.find("\n");
while (newline != std::string::npos)
Expand All @@ -192,6 +187,7 @@ Core::DeviceRemoval PipeDevice::UpdateInput()
newline = m_buf.find("\n");
}
} while (!finished && Config::Get(Config::SLIPPI_BLOCKING_PIPES));
return Core::DeviceRemoval::Keep;
}

void PipeDevice::AddAxis(const std::string& name, double value)
Expand Down

0 comments on commit b8ec612

Please sign in to comment.