diff options
| author | 2014-08-06 23:11:38 +0200 | |
|---|---|---|
| committer | 2014-08-06 23:11:38 +0200 | |
| commit | 191186a39cd3d31235f43db63c94d1b206131f1d (patch) | |
| tree | c71639c799748c983eb1e1fb47d0cfa4fd7b43bd | |
| parent | d9176411fc566299a50d365c74b2d077c3dbd293 (diff) | |
| download | libimobiledevice-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.
| -rw-r--r-- | common/userpref.c | 17 |
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() | |||
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | /** | 175 | /** |
| 176 | * Reads the BUID from a previously generated configuration file. | 176 | * Reads the SystemBUID from a previously generated configuration file. |
| 177 | * | 177 | * |
| 178 | * @note It is the responsibility of the calling function to free the returned system_buid | 178 | * @note It is the responsibility of the calling function to free the returned system_buid. |
| 179 | * @param system_buid A null terminated string containing a valid SystemBUID. | 179 | * @param system_buid A pointer that will be set to a newly allocated string containing the |
| 180 | * @return 1 if the system buid could be retrieved or 0 otherwise. | 180 | * SystemBUID upon successful return. |
| 181 | * @return 0 if the SystemBUID has been successfully retrieved or < 0 otherwise. | ||
| 181 | */ | 182 | */ |
| 182 | int userpref_read_system_buid(char **system_buid) | 183 | int userpref_read_system_buid(char **system_buid) |
| 183 | { | 184 | { |
| 184 | int res = usbmuxd_read_buid(system_buid); | 185 | int res = usbmuxd_read_buid(system_buid); |
| 185 | 186 | if (res == 0) { | |
| 186 | debug_info("using %s as %s", *system_buid, USERPREF_SYSTEM_BUID_KEY); | 187 | debug_info("using %s as %s", *system_buid, USERPREF_SYSTEM_BUID_KEY); |
| 187 | 188 | } else { | |
| 189 | debug_info("could not read system buid, error %d", res); | ||
| 190 | } | ||
| 188 | return res; | 191 | return res; |
| 189 | } | 192 | } |
| 190 | 193 | ||
