summaryrefslogtreecommitdiffstats
path: root/src/libusbmuxd.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2014-01-07 15:29:36 +0100
committerGravatar Nikias Bassen2014-01-07 15:29:36 +0100
commitb3a9eab2d67d3e7100b2e79fe87ae75bd074a8b0 (patch)
tree617f46a7314993cc4b6de1361ef6bf3ae21d3ac1 /src/libusbmuxd.c
parentd6544e43066bbe7b937515efb72774393b6dc0af (diff)
downloadlibusbmuxd-b3a9eab2d67d3e7100b2e79fe87ae75bd074a8b0.tar.gz
libusbmuxd-b3a9eab2d67d3e7100b2e79fe87ae75bd074a8b0.tar.bz2
Fix checking return values from usbmuxd
Diffstat (limited to 'src/libusbmuxd.c')
-rw-r--r--src/libusbmuxd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libusbmuxd.c b/src/libusbmuxd.c
index eaba498..2bea51a 100644
--- a/src/libusbmuxd.c
+++ b/src/libusbmuxd.c
@@ -1105,7 +1105,7 @@ int usbmuxd_read_buid(char **buid)
} else {
uint32_t rc = 0;
plist_t pl = NULL;
- if (usbmuxd_get_result(sfd, use_tag, &rc, &pl)) {
+ if (usbmuxd_get_result(sfd, use_tag, &rc, &pl) && (rc == 0)) {
plist_t node = plist_dict_get_item(pl, "BUID");
if (node && plist_get_node_type(node) == PLIST_STRING) {
plist_get_string_val(node, buid);
@@ -1146,7 +1146,7 @@ int usbmuxd_read_pair_record(const char* record_id, char **record_data, uint32_t
} else {
uint32_t rc = 0;
plist_t pl = NULL;
- if (usbmuxd_get_result(sfd, use_tag, &rc, &pl)) {
+ if (usbmuxd_get_result(sfd, use_tag, &rc, &pl) && (rc == 0)) {
plist_t node = plist_dict_get_item(pl, "PairRecordData");
if (node && plist_get_node_type(node) == PLIST_DATA) {
uint64_t int64val = 0;
@@ -1190,7 +1190,7 @@ int usbmuxd_save_pair_record(const char* record_id, const char *record_data, uin
DEBUG(1, "%s: Error sending SavePairRecord message!\n", __func__);
} else {
uint32_t rc = 0;
- if (usbmuxd_get_result(sfd, use_tag, &rc, NULL)) {
+ if (usbmuxd_get_result(sfd, use_tag, &rc, NULL) && (rc == 0)) {
ret = 0;
} else {
ret = -(int)rc;
@@ -1225,7 +1225,7 @@ int usbmuxd_delete_pair_record(const char* record_id)
DEBUG(1, "%s: Error sending DeletePairRecord message!\n", __func__);
} else {
uint32_t rc = 0;
- if (usbmuxd_get_result(sfd, use_tag, &rc, NULL)) {
+ if (usbmuxd_get_result(sfd, use_tag, &rc, NULL) && (rc == 0)) {
ret = 0;
} else {
ret = -(int)rc;