summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2014-01-10 20:07:46 +0100
committerGravatar Nikias Bassen2014-01-10 20:07:46 +0100
commit5005c852e20969868db8021709f372dd07d7821a (patch)
treed21b2275daf35da07a6927f83e1fe4ddcd9f2ec1 /src
parent232d27e318984f7b91cf2eb2ea8fcbbecfcf69e6 (diff)
downloadlibusbmuxd-5005c852e20969868db8021709f372dd07d7821a.tar.gz
libusbmuxd-5005c852e20969868db8021709f372dd07d7821a.tar.bz2
make usbmuxd_send() return a negative errno value like specified in the docs
Diffstat (limited to 'src')
-rw-r--r--src/libusbmuxd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libusbmuxd.c b/src/libusbmuxd.c
index 613fd1c..f52a1c2 100644
--- a/src/libusbmuxd.c
+++ b/src/libusbmuxd.c
@@ -1060,7 +1060,8 @@ int usbmuxd_send(int sfd, const char *data, uint32_t len, uint32_t *sent_bytes)
num_sent = send(sfd, (void*)data, len, 0);
if (num_sent < 0) {
*sent_bytes = 0;
- DEBUG(1, "%s: Error %d when sending: %s\n", __func__, num_sent, strerror(errno));
+ num_sent = errno;
+ DEBUG(1, "%s: Error %d when sending: %s\n", __func__, num_sent, strerror(num_sent));
return num_sent;
} else if ((uint32_t)num_sent < len) {
DEBUG(1, "%s: Warning: Did not send enough (only %d of %d)\n", __func__, num_sent, len);