diff options
| author | 2008-10-25 16:11:27 +0200 | |
|---|---|---|
| committer | 2008-10-25 16:52:20 +0200 | |
| commit | 0b2cfd2c7c6211ff5902e48720c34067f238ce90 (patch) | |
| tree | 9c30578b4288795e7589c959caa08f3547ca0b88 /src/userpref.c | |
| parent | bbd813da84c1ff8484bbd3eb7f575775271424da (diff) | |
| download | libimobiledevice-0b2cfd2c7c6211ff5902e48720c34067f238ce90.tar.gz libimobiledevice-0b2cfd2c7c6211ff5902e48720c34067f238ce90.tar.bz2 | |
Handle debugging through utilitary functions
Diffstat (limited to 'src/userpref.c')
| -rw-r--r-- | src/userpref.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/userpref.c b/src/userpref.c index 57946f7..db54679 100644 --- a/src/userpref.c +++ b/src/userpref.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <stdio.h> | 24 | #include <stdio.h> |
| 25 | #include <string.h> | 25 | #include <string.h> |
| 26 | #include "userpref.h" | 26 | #include "userpref.h" |
| 27 | #include "utils.h" | ||
| 27 | #include <string.h> | 28 | #include <string.h> |
| 28 | #include <stdlib.h> | 29 | #include <stdlib.h> |
| 29 | 30 | ||
| @@ -35,7 +36,6 @@ | |||
| 35 | #define LIBIPHONE_ROOT_CERTIF "RootCertificate.pem" | 36 | #define LIBIPHONE_ROOT_CERTIF "RootCertificate.pem" |
| 36 | #define LIBIPHONE_HOST_CERTIF "HostCertificate.pem" | 37 | #define LIBIPHONE_HOST_CERTIF "HostCertificate.pem" |
| 37 | 38 | ||
| 38 | extern int debug; | ||
| 39 | 39 | ||
| 40 | /** Creates a freedesktop compatible configuration directory for libiphone. | 40 | /** Creates a freedesktop compatible configuration directory for libiphone. |
| 41 | */ | 41 | */ |
| @@ -77,8 +77,7 @@ char *get_host_id() | |||
| 77 | g_key_file_free(key_file); | 77 | g_key_file_free(key_file); |
| 78 | g_free(config_file); | 78 | g_free(config_file); |
| 79 | 79 | ||
| 80 | if (debug) | 80 | log_debug_msg("get_host_id(): Using %s as HostID\n", host_id); |
| 81 | printf("get_host_id(): Using %s as HostID\n", host_id); | ||
| 82 | return host_id; | 81 | return host_id; |
| 83 | } | 82 | } |
| 84 | 83 | ||
| @@ -246,8 +245,7 @@ int init_config_file(char *host_id, gnutls_datum_t * root_key, gnutls_datum_t * | |||
| 246 | key_file = g_key_file_new(); | 245 | key_file = g_key_file_new(); |
| 247 | 246 | ||
| 248 | /* Store in config file */ | 247 | /* Store in config file */ |
| 249 | if (debug) | 248 | log_debug_msg("init_config_file(): setting hostID to %s\n", host_id); |
| 250 | printf("init_config_file(): setting hostID to %s\n", host_id); | ||
| 251 | g_key_file_set_value(key_file, "Global", "HostID", host_id); | 249 | g_key_file_set_value(key_file, "Global", "HostID", host_id); |
| 252 | 250 | ||
| 253 | /* Write config file on disk */ | 251 | /* Write config file on disk */ |
