summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2009-07-29 11:23:08 +0200
committerGravatar Martin Szulecki2009-07-29 11:23:08 +0200
commit73deab1a633ddc2a3ca3c5943622c2a5854677bf (patch)
tree074afa6f5818c720e7188b088fc53c8663706604
parentbcf67a0cfa12fabd49bb719ce960dfdcf74a1487 (diff)
downloadlibimobiledevice-73deab1a633ddc2a3ca3c5943622c2a5854677bf.tar.gz
libimobiledevice-73deab1a633ddc2a3ca3c5943622c2a5854677bf.tar.bz2
Add handling of afc_remove_path's unknown error code which is an ENOTEMPTY
-rw-r--r--include/libiphone/afc.h1
-rw-r--r--src/AFC.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/include/libiphone/afc.h b/include/libiphone/afc.h
index fe9b1bf..651621e 100644
--- a/include/libiphone/afc.h
+++ b/include/libiphone/afc.h
@@ -58,6 +58,7 @@ extern "C" {
#define AFC_E_MUX_ERROR 30
#define AFC_E_NO_MEM 31
#define AFC_E_NOT_ENOUGH_DATA 32
+#define AFC_E_DIR_NOT_EMPTY 33
typedef int16_t afc_error_t;
diff --git a/src/AFC.c b/src/AFC.c
index 6a58686..826c9e5 100644
--- a/src/AFC.c
+++ b/src/AFC.c
@@ -500,6 +500,10 @@ afc_error_t afc_remove_path(afc_client_t client, const char *path)
if (response)
free(response);
+ /* special case; unknown error actually means directory not empty */
+ if (ret == AFC_E_UNKNOWN_ERROR)
+ ret = AFC_E_DIR_NOT_EMPTY;
+
afc_unlock(client);
return ret;