diff options
Diffstat (limited to 'cmds/idmap/scan.cpp')
-rw-r--r-- | cmds/idmap/scan.cpp | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/cmds/idmap/scan.cpp b/cmds/idmap/scan.cpp index 1153f38a9c02..4f19a74ad9ba 100644 --- a/cmds/idmap/scan.cpp +++ b/cmds/idmap/scan.cpp @@ -64,30 +64,6 @@ namespace { return String8(tmp); } - int mkdir_p(const String8& path, uid_t uid, gid_t gid) - { - static const mode_t mode = - S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH; - struct stat st; - - if (stat(path.string(), &st) == 0) { - return 0; - } - if (mkdir_p(path.getPathDir(), uid, gid) < 0) { - return -1; - } - if (mkdir(path.string(), 0755) != 0) { - return -1; - } - if (chown(path.string(), uid, gid) == -1) { - return -1; - } - if (chmod(path.string(), mode) == -1) { - return -1; - } - return 0; - } - int parse_overlay_tag(const ResXMLTree& parser, const char *target_package_name) { const size_t N = parser.getAttributeCount(); @@ -98,7 +74,7 @@ namespace { String16 key(parser.getAttributeName(i, &len)); if (key == String16("targetPackage")) { const uint16_t *p = parser.getAttributeStringValue(i, &len); - if (p) { + if (p != NULL) { target = String16(p, len); } } else if (key == String16("priority")) { @@ -164,7 +140,7 @@ namespace { return -1; } FileMap *dataMap = zip->createEntryFileMap(entry); - if (!dataMap) { + if (dataMap == NULL) { ALOGW("%s: failed to create FileMap\n", __FUNCTION__); return -1; } |