summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/afc.c16
-rw-r--r--src/house_arrest.c52
-rw-r--r--src/idevice.c48
-rw-r--r--src/lockdown.c1
-rw-r--r--src/misagent.c50
-rw-r--r--src/sbservices.c26
6 files changed, 97 insertions, 96 deletions
diff --git a/src/afc.c b/src/afc.c
index e3da184..bdfa30e 100644
--- a/src/afc.c
+++ b/src/afc.c
@@ -1371,15 +1371,15 @@ afc_error_t afc_set_file_time(afc_client_t client, const char *path, uint64_t mt
afc_error_t afc_dictionary_free(char **dictionary)
{
- int i = 0;
+ int i = 0;
- if (!dictionary)
- return AFC_E_INVALID_ARG;
+ if (!dictionary)
+ return AFC_E_INVALID_ARG;
- for (i = 0; dictionary[i]; i++) {
- free(dictionary[i]);
- }
- free(dictionary);
+ for (i = 0; dictionary[i]; i++) {
+ free(dictionary[i]);
+ }
+ free(dictionary);
- return AFC_E_SUCCESS;
+ return AFC_E_SUCCESS;
}
diff --git a/src/house_arrest.c b/src/house_arrest.c
index f4314e7..5a23aff 100644
--- a/src/house_arrest.c
+++ b/src/house_arrest.c
@@ -40,19 +40,19 @@
*/
static house_arrest_error_t house_arrest_error(property_list_service_error_t err)
{
- switch (err) {
- case PROPERTY_LIST_SERVICE_E_SUCCESS:
- return HOUSE_ARREST_E_SUCCESS;
- case PROPERTY_LIST_SERVICE_E_INVALID_ARG:
- return HOUSE_ARREST_E_INVALID_ARG;
- case PROPERTY_LIST_SERVICE_E_PLIST_ERROR:
- return HOUSE_ARREST_E_PLIST_ERROR;
- case PROPERTY_LIST_SERVICE_E_MUX_ERROR:
- return HOUSE_ARREST_E_CONN_FAILED;
- default:
- break;
- }
- return HOUSE_ARREST_E_UNKNOWN_ERROR;
+ switch (err) {
+ case PROPERTY_LIST_SERVICE_E_SUCCESS:
+ return HOUSE_ARREST_E_SUCCESS;
+ case PROPERTY_LIST_SERVICE_E_INVALID_ARG:
+ return HOUSE_ARREST_E_INVALID_ARG;
+ case PROPERTY_LIST_SERVICE_E_PLIST_ERROR:
+ return HOUSE_ARREST_E_PLIST_ERROR;
+ case PROPERTY_LIST_SERVICE_E_MUX_ERROR:
+ return HOUSE_ARREST_E_CONN_FAILED;
+ default:
+ break;
+ }
+ return HOUSE_ARREST_E_UNKNOWN_ERROR;
}
/**
@@ -151,16 +151,16 @@ house_arrest_error_t house_arrest_client_free(house_arrest_client_t client)
house_arrest_error_t house_arrest_send_request(house_arrest_client_t client, plist_t dict)
{
if (!client || !client->parent || !dict)
- return HOUSE_ARREST_E_INVALID_ARG;
+ return HOUSE_ARREST_E_INVALID_ARG;
if (plist_get_node_type(dict) != PLIST_DICT)
return HOUSE_ARREST_E_PLIST_ERROR;
if (client->mode != HOUSE_ARREST_CLIENT_MODE_NORMAL)
return HOUSE_ARREST_E_INVALID_MODE;
house_arrest_error_t res = house_arrest_error(property_list_service_send_xml_plist(client->parent, dict));
- if (res != HOUSE_ARREST_E_SUCCESS) {
- debug_info("could not send plist, error %d", res);
- }
+ if (res != HOUSE_ARREST_E_SUCCESS) {
+ debug_info("could not send plist, error %d", res);
+ }
return res;
}
@@ -186,7 +186,7 @@ house_arrest_error_t house_arrest_send_request(house_arrest_client_t client, pli
house_arrest_error_t house_arrest_send_command(house_arrest_client_t client, const char *command, const char *appid)
{
if (!client || !client->parent || !command || !appid)
- return HOUSE_ARREST_E_INVALID_ARG;
+ return HOUSE_ARREST_E_INVALID_ARG;
if (client->mode != HOUSE_ARREST_CLIENT_MODE_NORMAL)
return HOUSE_ARREST_E_INVALID_MODE;
@@ -220,18 +220,18 @@ house_arrest_error_t house_arrest_send_command(house_arrest_client_t client, con
house_arrest_error_t house_arrest_get_result(house_arrest_client_t client, plist_t *dict)
{
if (!client || !client->parent)
- return HOUSE_ARREST_E_INVALID_ARG;
+ return HOUSE_ARREST_E_INVALID_ARG;
if (client->mode != HOUSE_ARREST_CLIENT_MODE_NORMAL)
return HOUSE_ARREST_E_INVALID_MODE;
house_arrest_error_t res = house_arrest_error(property_list_service_receive_plist(client->parent, dict));
- if (res != HOUSE_ARREST_E_SUCCESS) {
- debug_info("could not get result, error %d", res);
- if (*dict) {
- plist_free(*dict);
- *dict = NULL;
- }
- }
+ if (res != HOUSE_ARREST_E_SUCCESS) {
+ debug_info("could not get result, error %d", res);
+ if (*dict) {
+ plist_free(*dict);
+ *dict = NULL;
+ }
+ }
return res;
}
diff --git a/src/idevice.c b/src/idevice.c
index b067fa5..ec426e5 100644
--- a/src/idevice.c
+++ b/src/idevice.c
@@ -71,7 +71,7 @@ idevice_error_t idevice_event_subscribe(idevice_event_cb_t callback, void *user_
{
event_cb = callback;
int res = usbmuxd_subscribe(usbmux_event_cb, user_data);
- if (res != 0) {
+ if (res != 0) {
event_cb = NULL;
debug_info("Error %d when subscribing usbmux event callback!", res);
return IDEVICE_E_UNKNOWN_ERROR;
@@ -597,28 +597,28 @@ static int ssl_verify_callback(int ok, X509_STORE_CTX *ctx)
#ifndef STRIP_DEBUG_CODE
static const char *errorstring(int e)
{
- switch(e) {
- case SSL_ERROR_NONE:
- return "SSL_ERROR_NONE";
- case SSL_ERROR_SSL:
- return "SSL_ERROR_SSL";
- case SSL_ERROR_WANT_READ:
- return "SSL_ERROR_WANT_READ";
- case SSL_ERROR_WANT_WRITE:
- return "SSL_ERROR_WANT_WRITE";
- case SSL_ERROR_WANT_X509_LOOKUP:
- return "SSL_ERROR_WANT_X509_LOOKUP";
- case SSL_ERROR_SYSCALL:
- return "SSL_ERROR_SYSCALL";
- case SSL_ERROR_ZERO_RETURN:
- return "SSL_ERROR_ZERO_RETURN";
- case SSL_ERROR_WANT_CONNECT:
- return "SSL_ERROR_WANT_CONNECT";
- case SSL_ERROR_WANT_ACCEPT:
- return "SSL_ERROR_WANT_ACCEPT";
- default:
- return "UNKOWN_ERROR_VALUE";
- }
+ switch(e) {
+ case SSL_ERROR_NONE:
+ return "SSL_ERROR_NONE";
+ case SSL_ERROR_SSL:
+ return "SSL_ERROR_SSL";
+ case SSL_ERROR_WANT_READ:
+ return "SSL_ERROR_WANT_READ";
+ case SSL_ERROR_WANT_WRITE:
+ return "SSL_ERROR_WANT_WRITE";
+ case SSL_ERROR_WANT_X509_LOOKUP:
+ return "SSL_ERROR_WANT_X509_LOOKUP";
+ case SSL_ERROR_SYSCALL:
+ return "SSL_ERROR_SYSCALL";
+ case SSL_ERROR_ZERO_RETURN:
+ return "SSL_ERROR_ZERO_RETURN";
+ case SSL_ERROR_WANT_CONNECT:
+ return "SSL_ERROR_WANT_CONNECT";
+ case SSL_ERROR_WANT_ACCEPT:
+ return "SSL_ERROR_WANT_ACCEPT";
+ default:
+ return "UNKOWN_ERROR_VALUE";
+ }
}
#endif
#endif
@@ -726,7 +726,7 @@ idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection)
SSL_set_bio(ssl, ssl_bio, ssl_bio);
return_me = SSL_do_handshake(ssl);
- if (return_me != 1) {
+ if (return_me != 1) {
debug_info("ERROR in SSL_do_handshake: %s", errorstring(SSL_get_error(ssl, return_me)));
BIO_free(ssl_bio);
SSL_CTX_free(ssl_ctx);
diff --git a/src/lockdown.c b/src/lockdown.c
index d94fabb..690ab56 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -1195,6 +1195,7 @@ lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client)
}
plist_free(dict);
dict = NULL;
+
return ret;
}
diff --git a/src/misagent.c b/src/misagent.c
index 750cf52..a9bf89b 100644
--- a/src/misagent.c
+++ b/src/misagent.c
@@ -40,19 +40,19 @@
*/
static misagent_error_t misagent_error(property_list_service_error_t err)
{
- switch (err) {
- case PROPERTY_LIST_SERVICE_E_SUCCESS:
- return MISAGENT_E_SUCCESS;
- case PROPERTY_LIST_SERVICE_E_INVALID_ARG:
- return MISAGENT_E_INVALID_ARG;
- case PROPERTY_LIST_SERVICE_E_PLIST_ERROR:
- return MISAGENT_E_PLIST_ERROR;
- case PROPERTY_LIST_SERVICE_E_MUX_ERROR:
- return MISAGENT_E_CONN_FAILED;
- default:
- break;
- }
- return MISAGENT_E_UNKNOWN_ERROR;
+ switch (err) {
+ case PROPERTY_LIST_SERVICE_E_SUCCESS:
+ return MISAGENT_E_SUCCESS;
+ case PROPERTY_LIST_SERVICE_E_INVALID_ARG:
+ return MISAGENT_E_INVALID_ARG;
+ case PROPERTY_LIST_SERVICE_E_PLIST_ERROR:
+ return MISAGENT_E_PLIST_ERROR;
+ case PROPERTY_LIST_SERVICE_E_MUX_ERROR:
+ return MISAGENT_E_CONN_FAILED;
+ default:
+ break;
+ }
+ return MISAGENT_E_UNKNOWN_ERROR;
}
/**
@@ -171,7 +171,7 @@ misagent_error_t misagent_client_free(misagent_client_t client)
misagent_error_t misagent_install(misagent_client_t client, plist_t profile)
{
if (!client || !client->parent || !profile || (plist_get_node_type(profile) != PLIST_DATA))
- return MISAGENT_E_INVALID_ARG;
+ return MISAGENT_E_INVALID_ARG;
client->last_error = MISAGENT_E_UNKNOWN_ERROR;
@@ -184,10 +184,10 @@ misagent_error_t misagent_install(misagent_client_t client, plist_t profile)
plist_free(dict);
dict = NULL;
- if (res != MISAGENT_E_SUCCESS) {
- debug_info("could not send plist, error %d", res);
+ if (res != MISAGENT_E_SUCCESS) {
+ debug_info("could not send plist, error %d", res);
return res;
- }
+ }
res = misagent_error(property_list_service_receive_plist(client->parent, &dict));
if (res != MISAGENT_E_SUCCESS) {
@@ -222,7 +222,7 @@ misagent_error_t misagent_install(misagent_client_t client, plist_t profile)
misagent_error_t misagent_copy(misagent_client_t client, plist_t* profiles)
{
if (!client || !client->parent || !profiles)
- return MISAGENT_E_INVALID_ARG;
+ return MISAGENT_E_INVALID_ARG;
client->last_error = MISAGENT_E_UNKNOWN_ERROR;
@@ -234,10 +234,10 @@ misagent_error_t misagent_copy(misagent_client_t client, plist_t* profiles)
plist_free(dict);
dict = NULL;
- if (res != MISAGENT_E_SUCCESS) {
- debug_info("could not send plist, error %d", res);
+ if (res != MISAGENT_E_SUCCESS) {
+ debug_info("could not send plist, error %d", res);
return res;
- }
+ }
res = misagent_error(property_list_service_receive_plist(client->parent, &dict));
if (res != MISAGENT_E_SUCCESS) {
@@ -273,7 +273,7 @@ misagent_error_t misagent_copy(misagent_client_t client, plist_t* profiles)
misagent_error_t misagent_remove(misagent_client_t client, const char* profileID)
{
if (!client || !client->parent || !profileID)
- return MISAGENT_E_INVALID_ARG;
+ return MISAGENT_E_INVALID_ARG;
client->last_error = MISAGENT_E_UNKNOWN_ERROR;
@@ -286,10 +286,10 @@ misagent_error_t misagent_remove(misagent_client_t client, const char* profileID
plist_free(dict);
dict = NULL;
- if (res != MISAGENT_E_SUCCESS) {
- debug_info("could not send plist, error %d", res);
+ if (res != MISAGENT_E_SUCCESS) {
+ debug_info("could not send plist, error %d", res);
return res;
- }
+ }
res = misagent_error(property_list_service_receive_plist(client->parent, &dict));
if (res != MISAGENT_E_SUCCESS) {
diff --git a/src/sbservices.c b/src/sbservices.c
index 9b66c7f..c761070 100644
--- a/src/sbservices.c
+++ b/src/sbservices.c
@@ -61,19 +61,19 @@ static void sbs_unlock(sbservices_client_t client)
*/
static sbservices_error_t sbservices_error(property_list_service_error_t err)
{
- switch (err) {
- case PROPERTY_LIST_SERVICE_E_SUCCESS:
- return SBSERVICES_E_SUCCESS;
- case PROPERTY_LIST_SERVICE_E_INVALID_ARG:
- return SBSERVICES_E_INVALID_ARG;
- case PROPERTY_LIST_SERVICE_E_PLIST_ERROR:
- return SBSERVICES_E_PLIST_ERROR;
- case PROPERTY_LIST_SERVICE_E_MUX_ERROR:
- return SBSERVICES_E_CONN_FAILED;
- default:
- break;
- }
- return SBSERVICES_E_UNKNOWN_ERROR;
+ switch (err) {
+ case PROPERTY_LIST_SERVICE_E_SUCCESS:
+ return SBSERVICES_E_SUCCESS;
+ case PROPERTY_LIST_SERVICE_E_INVALID_ARG:
+ return SBSERVICES_E_INVALID_ARG;
+ case PROPERTY_LIST_SERVICE_E_PLIST_ERROR:
+ return SBSERVICES_E_PLIST_ERROR;
+ case PROPERTY_LIST_SERVICE_E_MUX_ERROR:
+ return SBSERVICES_E_CONN_FAILED;
+ default:
+ break;
+ }
+ return SBSERVICES_E_UNKNOWN_ERROR;
}
/**