Move mkdirs to adb_utils.
There were duplicate implementations in commandline.cpp and
file_sync_client.cpp.
Change-Id: Ib448f76c0d7ffdcd577336b1c610a881425bc2db
diff --git a/adb/file_sync_client.cpp b/adb/file_sync_client.cpp
index 1dc711ae..49d42a3 100644
--- a/adb/file_sync_client.cpp
+++ b/adb/file_sync_client.cpp
@@ -32,6 +32,7 @@
#include "adb.h"
#include "adb_client.h"
#include "adb_io.h"
+#include "adb_utils.h"
#include "file_sync_service.h"
static unsigned long long total_bytes;
@@ -395,25 +396,6 @@
return -1;
}
-static int mkdirs(const char *name)
-{
- int ret;
- char *x = (char *)name + 1;
-
- for(;;) {
- x = adb_dirstart(x);
- if(x == 0) return 0;
- *x = 0;
- ret = adb_mkdir(name, 0775);
- *x = OS_PATH_SEPARATOR;
- if((ret < 0) && (errno != EEXIST)) {
- return ret;
- }
- x++;
- }
- return 0;
-}
-
static int sync_recv(int fd, const char* rpath, const char* lpath, int show_progress) {
syncmsg msg;
int len;