diff options
author | Nikias Bassen | 2014-01-10 20:07:46 +0100 |
---|---|---|
committer | Nikias Bassen | 2014-01-10 20:07:46 +0100 |
commit | 5005c852e20969868db8021709f372dd07d7821a (patch) | |
tree | d21b2275daf35da07a6927f83e1fe4ddcd9f2ec1 | |
parent | 232d27e318984f7b91cf2eb2ea8fcbbecfcf69e6 (diff) | |
download | libusbmuxd-5005c852e20969868db8021709f372dd07d7821a.tar.gz libusbmuxd-5005c852e20969868db8021709f372dd07d7821a.tar.bz2 |
make usbmuxd_send() return a negative errno value like specified in the docs
-rw-r--r-- | src/libusbmuxd.c | 3 |
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); |