summaryrefslogtreecommitdiff
path: root/src/remote.cc
diff options
context:
space:
mode:
authorFrank LENORMAND <lenormf@gmail.com>2015-12-10 11:00:10 +0300
committerFrank LENORMAND <lenormf@gmail.com>2015-12-10 11:00:10 +0300
commitdf31b88187bc1e262abbeddc63c6cde6331bf07a (patch)
treec2c20df6a0382de5f97d77ff9606cef22b48f712 /src/remote.cc
parent2ca1784495f1497b7d93cd0401244ad7d3bcc900 (diff)
Fix "unused result" warnings for several system calls.
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);
}