summaryrefslogtreecommitdiff
path: root/src/remote.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/remote.cc')
-rw-r--r--src/remote.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/remote.cc b/src/remote.cc
index 6169e906..e15d4d0f 100644
--- a/src/remote.cc
+++ b/src/remote.cc
@@ -532,7 +532,8 @@ void RemoteClient::write_next_key()
void send_command(StringView session, StringView command)
{
int sock = connect_to(session);
- ::write(sock, command.data(), (int)command.length());
+ if (::write(sock, command.data(), (int)command.length()) < 0)
+ throw runtime_error(format("unable to write data to socket (fd: {}; errno: {})", sock, ::strerror(errno)));
close(sock);
}