summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2014-08-06 23:11:38 +0200
committerGravatar Nikias Bassen2014-08-06 23:11:38 +0200
commit191186a39cd3d31235f43db63c94d1b206131f1d (patch)
treec71639c799748c983eb1e1fb47d0cfa4fd7b43bd /common
parentd9176411fc566299a50d365c74b2d077c3dbd293 (diff)
downloadlibimobiledevice-191186a39cd3d31235f43db63c94d1b206131f1d.tar.gz
libimobiledevice-191186a39cd3d31235f43db63c94d1b206131f1d.tar.bz2
userpref: Fix wrong documentation about return values of userpref_read_system_buid()
Also, add a debug message that will print the actual error code.
Diffstat (limited to 'common')
-rw-r--r--common/userpref.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/common/userpref.c b/common/userpref.c
index 8076287..fd7022c 100644
--- a/common/userpref.c
+++ b/common/userpref.c
@@ -173,18 +173,21 @@ const char *userpref_get_config_dir()
}
/**
- * Reads the BUID from a previously generated configuration file.
+ * Reads the SystemBUID from a previously generated configuration file.
*
- * @note It is the responsibility of the calling function to free the returned system_buid
- * @param system_buid A null terminated string containing a valid SystemBUID.
- * @return 1 if the system buid could be retrieved or 0 otherwise.
+ * @note It is the responsibility of the calling function to free the returned system_buid.
+ * @param system_buid A pointer that will be set to a newly allocated string containing the
+ * SystemBUID upon successful return.
+ * @return 0 if the SystemBUID has been successfully retrieved or < 0 otherwise.
*/
int userpref_read_system_buid(char **system_buid)
{
int res = usbmuxd_read_buid(system_buid);
-
- debug_info("using %s as %s", *system_buid, USERPREF_SYSTEM_BUID_KEY);
-
+ if (res == 0) {
+ debug_info("using %s as %s", *system_buid, USERPREF_SYSTEM_BUID_KEY);
+ } else {
+ debug_info("could not read system buid, error %d", res);
+ }
return res;
}