Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2dd82d8c authored by Brian Swetland's avatar Brian Swetland
Browse files

remove mkdirs/etc which caused us to depend on libutils



Depending on libutils causes a build layering violation,
requiring frameworks/base/... for libhost...

Signed-off-by: default avatarBrian Swetland <swetland@google.com>
parent 39528d6b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@ include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
	CopyFile.c \
	Directories.cpp \
	pseudolocalize.cpp

ifeq ($(HOST_OS),cygwin)

libs/host/Directories.cpp

deleted100644 → 0
+0 −42
Original line number Diff line number Diff line
#include <host/Directories.h>
#include <utils/String8.h>
#include <sys/types.h>
#include <sys/stat.h>

#ifdef HAVE_MS_C_RUNTIME
#include <direct.h>
#endif                    

using namespace android;
using namespace std;

string
parent_dir(const string& path)
{
    return string(String8(path.c_str()).getPathDir().string());
}

int
mkdirs(const char* last)
{
    String8 dest;
    const char* s = last-1;
    int err;
    do {
        s++;
        if (s > last && (*s == '.' || *s == 0)) {
            String8 part(last, s-last);
            dest.appendPath(part);
#ifdef HAVE_MS_C_RUNTIME
            err = _mkdir(dest.string());
#else                    
            err = mkdir(dest.string(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP);
#endif                    
            if (err != 0) {
                return err;
            }
            last = s+1;
        }
    } while (*s);
    return 0;
}