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

Commit 1fa76a67 authored by Mathieu Chartier's avatar Mathieu Chartier Committed by android-build-merger
Browse files

Merge "[installd] Modernize codebase by replacing NULL with nullptr"

am: a6ada234

Change-Id: I89a2a44bddda13f3e5e080a841de640493305ee8
parents 84ce4bac a6ada234
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -73,7 +73,7 @@ int CacheItem::purge() {
        FTS *fts;
        FTS *fts;
        FTSENT *p;
        FTSENT *p;
        char *argv[] = { (char*) path.c_str(), nullptr };
        char *argv[] = { (char*) path.c_str(), nullptr };
        if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, NULL))) {
        if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, nullptr))) {
            PLOG(WARNING) << "Failed to fts_open " << path;
            PLOG(WARNING) << "Failed to fts_open " << path;
            return -1;
            return -1;
        }
        }
+1 −1
Original line number Original line Diff line number Diff line
@@ -103,7 +103,7 @@ void CacheTracker::loadItemsFrom(const std::string& path) {
    FTS *fts;
    FTS *fts;
    FTSENT *p;
    FTSENT *p;
    char *argv[] = { (char*) path.c_str(), nullptr };
    char *argv[] = { (char*) path.c_str(), nullptr };
    if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, NULL))) {
    if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, nullptr))) {
        PLOG(WARNING) << "Failed to fts_open " << path;
        PLOG(WARNING) << "Failed to fts_open " << path;
        return;
        return;
    }
    }
+18 −18
Original line number Original line Diff line number Diff line
@@ -661,7 +661,7 @@ binder::Status InstalldNativeService::fixupAppData(const std::unique_ptr<std::st
        auto ce_path = create_data_user_ce_path(uuid_, user);
        auto ce_path = create_data_user_ce_path(uuid_, user);
        auto de_path = create_data_user_de_path(uuid_, user);
        auto de_path = create_data_user_de_path(uuid_, user);
        char *argv[] = { (char*) ce_path.c_str(), (char*) de_path.c_str(), nullptr };
        char *argv[] = { (char*) ce_path.c_str(), (char*) de_path.c_str(), nullptr };
        if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, NULL))) {
        if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, nullptr))) {
            return error("Failed to fts_open");
            return error("Failed to fts_open");
        }
        }
        while ((p = fts_read(fts)) != nullptr) {
        while ((p = fts_read(fts)) != nullptr) {
@@ -786,7 +786,7 @@ binder::Status InstalldNativeService::moveCompleteApp(const std::unique_ptr<std:
        };
        };


        LOG(DEBUG) << "Copying " << from << " to " << to;
        LOG(DEBUG) << "Copying " << from << " to " << to;
        int rc = android_fork_execvp(ARRAY_SIZE(argv), argv, NULL, false, true);
        int rc = android_fork_execvp(ARRAY_SIZE(argv), argv, nullptr, false, true);
        if (rc != 0) {
        if (rc != 0) {
            res = error(rc, "Failed copying " + from + " to " + to);
            res = error(rc, "Failed copying " + from + " to " + to);
            goto fail;
            goto fail;
@@ -832,7 +832,7 @@ binder::Status InstalldNativeService::moveCompleteApp(const std::unique_ptr<std:
            argv[7] = (char*) to.c_str();
            argv[7] = (char*) to.c_str();


            LOG(DEBUG) << "Copying " << from << " to " << to;
            LOG(DEBUG) << "Copying " << from << " to " << to;
            int rc = android_fork_execvp(ARRAY_SIZE(argv), argv, NULL, false, true);
            int rc = android_fork_execvp(ARRAY_SIZE(argv), argv, nullptr, false, true);
            if (rc != 0) {
            if (rc != 0) {
                res = error(rc, "Failed copying " + from + " to " + to);
                res = error(rc, "Failed copying " + from + " to " + to);
                goto fail;
                goto fail;
@@ -845,7 +845,7 @@ binder::Status InstalldNativeService::moveCompleteApp(const std::unique_ptr<std:
            argv[7] = (char*) to.c_str();
            argv[7] = (char*) to.c_str();


            LOG(DEBUG) << "Copying " << from << " to " << to;
            LOG(DEBUG) << "Copying " << from << " to " << to;
            int rc = android_fork_execvp(ARRAY_SIZE(argv), argv, NULL, false, true);
            int rc = android_fork_execvp(ARRAY_SIZE(argv), argv, nullptr, false, true);
            if (rc != 0) {
            if (rc != 0) {
                res = error(rc, "Failed copying " + from + " to " + to);
                res = error(rc, "Failed copying " + from + " to " + to);
                goto fail;
                goto fail;
@@ -868,20 +868,20 @@ fail:
    // Nuke everything we might have already copied
    // Nuke everything we might have already copied
    {
    {
        auto to = create_data_app_package_path(to_uuid, data_app_name);
        auto to = create_data_app_package_path(to_uuid, data_app_name);
        if (delete_dir_contents(to.c_str(), 1, NULL) != 0) {
        if (delete_dir_contents(to.c_str(), 1, nullptr) != 0) {
            LOG(WARNING) << "Failed to rollback " << to;
            LOG(WARNING) << "Failed to rollback " << to;
        }
        }
    }
    }
    for (auto user : users) {
    for (auto user : users) {
        {
        {
            auto to = create_data_user_de_package_path(to_uuid, user, package_name);
            auto to = create_data_user_de_package_path(to_uuid, user, package_name);
            if (delete_dir_contents(to.c_str(), 1, NULL) != 0) {
            if (delete_dir_contents(to.c_str(), 1, nullptr) != 0) {
                LOG(WARNING) << "Failed to rollback " << to;
                LOG(WARNING) << "Failed to rollback " << to;
            }
            }
        }
        }
        {
        {
            auto to = create_data_user_ce_package_path(to_uuid, user, package_name);
            auto to = create_data_user_ce_package_path(to_uuid, user, package_name);
            if (delete_dir_contents(to.c_str(), 1, NULL) != 0) {
            if (delete_dir_contents(to.c_str(), 1, nullptr) != 0) {
                LOG(WARNING) << "Failed to rollback " << to;
                LOG(WARNING) << "Failed to rollback " << to;
            }
            }
        }
        }
@@ -984,10 +984,10 @@ binder::Status InstalldNativeService::freeCache(const std::unique_ptr<std::strin
            auto media_path = findDataMediaPath(uuid, user) + "/Android/data/";
            auto media_path = findDataMediaPath(uuid, user) + "/Android/data/";
            char *argv[] = { (char*) ce_path.c_str(), (char*) de_path.c_str(),
            char *argv[] = { (char*) ce_path.c_str(), (char*) de_path.c_str(),
                    (char*) media_path.c_str(), nullptr };
                    (char*) media_path.c_str(), nullptr };
            if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, NULL))) {
            if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, nullptr))) {
                return error("Failed to fts_open");
                return error("Failed to fts_open");
            }
            }
            while ((p = fts_read(fts)) != NULL) {
            while ((p = fts_read(fts)) != nullptr) {
                if (p->fts_info == FTS_D && p->fts_level == 1) {
                if (p->fts_info == FTS_D && p->fts_level == 1) {
                    uid_t uid = p->fts_statp->st_uid;
                    uid_t uid = p->fts_statp->st_uid;
                    if (multiuser_get_app_id(uid) == AID_MEDIA_RW) {
                    if (multiuser_get_app_id(uid) == AID_MEDIA_RW) {
@@ -1337,11 +1337,11 @@ static void collectManualExternalStatsForUser(const std::string& path, struct st
    FTS *fts;
    FTS *fts;
    FTSENT *p;
    FTSENT *p;
    char *argv[] = { (char*) path.c_str(), nullptr };
    char *argv[] = { (char*) path.c_str(), nullptr };
    if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, NULL))) {
    if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, nullptr))) {
        PLOG(ERROR) << "Failed to fts_open " << path;
        PLOG(ERROR) << "Failed to fts_open " << path;
        return;
        return;
    }
    }
    while ((p = fts_read(fts)) != NULL) {
    while ((p = fts_read(fts)) != nullptr) {
        p->fts_number = p->fts_parent->fts_number;
        p->fts_number = p->fts_parent->fts_number;
        switch (p->fts_info) {
        switch (p->fts_info) {
        case FTS_D:
        case FTS_D:
@@ -1747,10 +1747,10 @@ binder::Status InstalldNativeService::getExternalSize(const std::unique_ptr<std:
        FTSENT *p;
        FTSENT *p;
        auto path = create_data_media_path(uuid_, userId);
        auto path = create_data_media_path(uuid_, userId);
        char *argv[] = { (char*) path.c_str(), nullptr };
        char *argv[] = { (char*) path.c_str(), nullptr };
        if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, NULL))) {
        if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, nullptr))) {
            return error("Failed to fts_open " + path);
            return error("Failed to fts_open " + path);
        }
        }
        while ((p = fts_read(fts)) != NULL) {
        while ((p = fts_read(fts)) != nullptr) {
            char* ext;
            char* ext;
            int64_t size = (p->fts_statp->st_blocks * 512);
            int64_t size = (p->fts_statp->st_blocks * 512);
            switch (p->fts_info) {
            switch (p->fts_info) {
@@ -1980,7 +1980,7 @@ binder::Status InstalldNativeService::linkNativeLibraryDirectory(
        }
        }
    } else {
    } else {
        if (S_ISDIR(libStat.st_mode)) {
        if (S_ISDIR(libStat.st_mode)) {
            if (delete_dir_contents(libsymlink, 1, NULL) < 0) {
            if (delete_dir_contents(libsymlink, 1, nullptr) < 0) {
                res = error("Failed to delete " + _libsymlink);
                res = error("Failed to delete " + _libsymlink);
                goto out;
                goto out;
            }
            }
@@ -2022,14 +2022,14 @@ out:
static void run_idmap(const char *target_apk, const char *overlay_apk, int idmap_fd)
static void run_idmap(const char *target_apk, const char *overlay_apk, int idmap_fd)
{
{
    execl(kIdMapPath, kIdMapPath, "--fd", target_apk, overlay_apk,
    execl(kIdMapPath, kIdMapPath, "--fd", target_apk, overlay_apk,
            StringPrintf("%d", idmap_fd).c_str(), (char*)NULL);
            StringPrintf("%d", idmap_fd).c_str(), (char*)nullptr);
    PLOG(ERROR) << "execl (" << kIdMapPath << ") failed";
    PLOG(ERROR) << "execl (" << kIdMapPath << ") failed";
}
}


static void run_verify_idmap(const char *target_apk, const char *overlay_apk, int idmap_fd)
static void run_verify_idmap(const char *target_apk, const char *overlay_apk, int idmap_fd)
{
{
    execl(kIdMapPath, kIdMapPath, "--verify", target_apk, overlay_apk,
    execl(kIdMapPath, kIdMapPath, "--verify", target_apk, overlay_apk,
            StringPrintf("%d", idmap_fd).c_str(), (char*)NULL);
            StringPrintf("%d", idmap_fd).c_str(), (char*)nullptr);
    PLOG(ERROR) << "execl (" << kIdMapPath << ") failed";
    PLOG(ERROR) << "execl (" << kIdMapPath << ") failed";
}
}


@@ -2080,7 +2080,7 @@ static bool delete_stale_idmap(const char* target_apk, const char* overlay_apk,
static int flatten_path(const char *prefix, const char *suffix,
static int flatten_path(const char *prefix, const char *suffix,
        const char *overlay_path, char *idmap_path, size_t N)
        const char *overlay_path, char *idmap_path, size_t N)
{
{
    if (overlay_path == NULL || idmap_path == NULL) {
    if (overlay_path == nullptr || idmap_path == nullptr) {
        return -1;
        return -1;
    }
    }
    const size_t len_overlay_path = strlen(overlay_path);
    const size_t len_overlay_path = strlen(overlay_path);
@@ -2421,7 +2421,7 @@ binder::Status InstalldNativeService::installApkVerity(const std::string& filePa
                     std::to_string(shmSize));
                     std::to_string(shmSize));
    }
    }
    auto data = std::unique_ptr<void, std::function<void (void *)>>(
    auto data = std::unique_ptr<void, std::function<void (void *)>>(
        mmap(NULL, contentSize, PROT_READ, MAP_SHARED, verityInputAshmem.get(), 0),
        mmap(nullptr, contentSize, PROT_READ, MAP_SHARED, verityInputAshmem.get(), 0),
        [contentSize] (void* ptr) {
        [contentSize] (void* ptr) {
          if (ptr != MAP_FAILED) {
          if (ptr != MAP_FAILED) {
            munmap(ptr, contentSize);
            munmap(ptr, contentSize);
+19 −19
Original line number Original line Diff line number Diff line
@@ -190,9 +190,9 @@ static int split_count(const char *str)
  strlcpy(buf, str, sizeof(buf));
  strlcpy(buf, str, sizeof(buf));
  char *pBuf = buf;
  char *pBuf = buf;


  while(strtok_r(pBuf, " ", &ctx) != NULL) {
  while(strtok_r(pBuf, " ", &ctx) != nullptr) {
    count++;
    count++;
    pBuf = NULL;
    pBuf = nullptr;
  }
  }


  return count;
  return count;
@@ -205,9 +205,9 @@ static int split(char *buf, const char **argv)
  char *tok;
  char *tok;
  char *pBuf = buf;
  char *pBuf = buf;


  while((tok = strtok_r(pBuf, " ", &ctx)) != NULL) {
  while((tok = strtok_r(pBuf, " ", &ctx)) != nullptr) {
    argv[count++] = tok;
    argv[count++] = tok;
    pBuf = NULL;
    pBuf = nullptr;
  }
  }


  return count;
  return count;
@@ -216,7 +216,7 @@ static int split(char *buf, const char **argv)
static const char* get_location_from_path(const char* path) {
static const char* get_location_from_path(const char* path) {
    static constexpr char kLocationSeparator = '/';
    static constexpr char kLocationSeparator = '/';
    const char *location = strrchr(path, kLocationSeparator);
    const char *location = strrchr(path, kLocationSeparator);
    if (location == NULL) {
    if (location == nullptr) {
        return path;
        return path;
    } else {
    } else {
        // Skip the separator character.
        // Skip the separator character.
@@ -243,17 +243,17 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd
    const char* relative_input_file_name = get_location_from_path(input_file_name);
    const char* relative_input_file_name = get_location_from_path(input_file_name);


    char dex2oat_Xms_flag[kPropertyValueMax];
    char dex2oat_Xms_flag[kPropertyValueMax];
    bool have_dex2oat_Xms_flag = get_property("dalvik.vm.dex2oat-Xms", dex2oat_Xms_flag, NULL) > 0;
    bool have_dex2oat_Xms_flag = get_property("dalvik.vm.dex2oat-Xms", dex2oat_Xms_flag, nullptr) > 0;


    char dex2oat_Xmx_flag[kPropertyValueMax];
    char dex2oat_Xmx_flag[kPropertyValueMax];
    bool have_dex2oat_Xmx_flag = get_property("dalvik.vm.dex2oat-Xmx", dex2oat_Xmx_flag, NULL) > 0;
    bool have_dex2oat_Xmx_flag = get_property("dalvik.vm.dex2oat-Xmx", dex2oat_Xmx_flag, nullptr) > 0;


    char dex2oat_threads_buf[kPropertyValueMax];
    char dex2oat_threads_buf[kPropertyValueMax];
    bool have_dex2oat_threads_flag = get_property(post_bootcomplete
    bool have_dex2oat_threads_flag = get_property(post_bootcomplete
                                                      ? "dalvik.vm.dex2oat-threads"
                                                      ? "dalvik.vm.dex2oat-threads"
                                                      : "dalvik.vm.boot-dex2oat-threads",
                                                      : "dalvik.vm.boot-dex2oat-threads",
                                                  dex2oat_threads_buf,
                                                  dex2oat_threads_buf,
                                                  NULL) > 0;
                                                  nullptr) > 0;
    char dex2oat_threads_arg[kPropertyValueMax + 2];
    char dex2oat_threads_arg[kPropertyValueMax + 2];
    if (have_dex2oat_threads_flag) {
    if (have_dex2oat_threads_flag) {
        sprintf(dex2oat_threads_arg, "-j%s", dex2oat_threads_buf);
        sprintf(dex2oat_threads_arg, "-j%s", dex2oat_threads_buf);
@@ -263,20 +263,20 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd
    sprintf(dex2oat_isa_features_key, "dalvik.vm.isa.%s.features", instruction_set);
    sprintf(dex2oat_isa_features_key, "dalvik.vm.isa.%s.features", instruction_set);
    char dex2oat_isa_features[kPropertyValueMax];
    char dex2oat_isa_features[kPropertyValueMax];
    bool have_dex2oat_isa_features = get_property(dex2oat_isa_features_key,
    bool have_dex2oat_isa_features = get_property(dex2oat_isa_features_key,
                                                  dex2oat_isa_features, NULL) > 0;
                                                  dex2oat_isa_features, nullptr) > 0;


    char dex2oat_isa_variant_key[kPropertyKeyMax];
    char dex2oat_isa_variant_key[kPropertyKeyMax];
    sprintf(dex2oat_isa_variant_key, "dalvik.vm.isa.%s.variant", instruction_set);
    sprintf(dex2oat_isa_variant_key, "dalvik.vm.isa.%s.variant", instruction_set);
    char dex2oat_isa_variant[kPropertyValueMax];
    char dex2oat_isa_variant[kPropertyValueMax];
    bool have_dex2oat_isa_variant = get_property(dex2oat_isa_variant_key,
    bool have_dex2oat_isa_variant = get_property(dex2oat_isa_variant_key,
                                                 dex2oat_isa_variant, NULL) > 0;
                                                 dex2oat_isa_variant, nullptr) > 0;


    const char *dex2oat_norelocation = "-Xnorelocate";
    const char *dex2oat_norelocation = "-Xnorelocate";
    bool have_dex2oat_relocation_skip_flag = false;
    bool have_dex2oat_relocation_skip_flag = false;


    char dex2oat_flags[kPropertyValueMax];
    char dex2oat_flags[kPropertyValueMax];
    int dex2oat_flags_count = get_property("dalvik.vm.dex2oat-flags",
    int dex2oat_flags_count = get_property("dalvik.vm.dex2oat-flags",
                                 dex2oat_flags, NULL) <= 0 ? 0 : split_count(dex2oat_flags);
                                 dex2oat_flags, nullptr) <= 0 ? 0 : split_count(dex2oat_flags);
    ALOGV("dalvik.vm.dex2oat-flags=%s\n", dex2oat_flags);
    ALOGV("dalvik.vm.dex2oat-flags=%s\n", dex2oat_flags);


    // If we are booting without the real /data, don't spend time compiling.
    // If we are booting without the real /data, don't spend time compiling.
@@ -291,14 +291,14 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd
    char app_image_format[kPropertyValueMax];
    char app_image_format[kPropertyValueMax];
    char image_format_arg[strlen("--image-format=") + kPropertyValueMax];
    char image_format_arg[strlen("--image-format=") + kPropertyValueMax];
    bool have_app_image_format =
    bool have_app_image_format =
            image_fd >= 0 && get_property("dalvik.vm.appimageformat", app_image_format, NULL) > 0;
            image_fd >= 0 && get_property("dalvik.vm.appimageformat", app_image_format, nullptr) > 0;
    if (have_app_image_format) {
    if (have_app_image_format) {
        sprintf(image_format_arg, "--image-format=%s", app_image_format);
        sprintf(image_format_arg, "--image-format=%s", app_image_format);
    }
    }


    char dex2oat_large_app_threshold[kPropertyValueMax];
    char dex2oat_large_app_threshold[kPropertyValueMax];
    bool have_dex2oat_large_app_threshold =
    bool have_dex2oat_large_app_threshold =
            get_property("dalvik.vm.dex2oat-very-large", dex2oat_large_app_threshold, NULL) > 0;
            get_property("dalvik.vm.dex2oat-very-large", dex2oat_large_app_threshold, nullptr) > 0;
    char dex2oat_large_app_threshold_arg[strlen("--very-large-app-threshold=") + kPropertyValueMax];
    char dex2oat_large_app_threshold_arg[strlen("--very-large-app-threshold=") + kPropertyValueMax];
    if (have_dex2oat_large_app_threshold) {
    if (have_dex2oat_large_app_threshold) {
        sprintf(dex2oat_large_app_threshold_arg,
        sprintf(dex2oat_large_app_threshold_arg,
@@ -400,7 +400,7 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd
    if (!have_dex2oat_compiler_filter_flag) {
    if (!have_dex2oat_compiler_filter_flag) {
        char dex2oat_compiler_filter_flag[kPropertyValueMax];
        char dex2oat_compiler_filter_flag[kPropertyValueMax];
        have_dex2oat_compiler_filter_flag = get_property("dalvik.vm.dex2oat-filter",
        have_dex2oat_compiler_filter_flag = get_property("dalvik.vm.dex2oat-filter",
                                                         dex2oat_compiler_filter_flag, NULL) > 0;
                                                         dex2oat_compiler_filter_flag, nullptr) > 0;
        if (have_dex2oat_compiler_filter_flag) {
        if (have_dex2oat_compiler_filter_flag) {
            sprintf(dex2oat_compiler_filter_arg,
            sprintf(dex2oat_compiler_filter_arg,
                    "--compiler-filter=%s",
                    "--compiler-filter=%s",
@@ -552,7 +552,7 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd
        argv[i++] = compilation_reason_arg.c_str();
        argv[i++] = compilation_reason_arg.c_str();
    }
    }
    // Do not add after dex2oat_flags, they should override others for debugging.
    // Do not add after dex2oat_flags, they should override others for debugging.
    argv[i] = NULL;
    argv[i] = nullptr;


    execv(dex2oat_bin, (char * const *)argv);
    execv(dex2oat_bin, (char * const *)argv);
    PLOG(ERROR) << "execv(" << dex2oat_bin << ") failed";
    PLOG(ERROR) << "execv(" << dex2oat_bin << ") failed";
@@ -792,7 +792,7 @@ static void run_profman(const std::vector<unique_fd>& profile_fds,
    }
    }


    // Do not add after dex2oat_flags, they should override others for debugging.
    // Do not add after dex2oat_flags, they should override others for debugging.
    argv[i] = NULL;
    argv[i] = nullptr;


    execv(profman_bin, (char * const *)argv);
    execv(profman_bin, (char * const *)argv);
    PLOG(ERROR) << "execv(" << profman_bin << ") failed";
    PLOG(ERROR) << "execv(" << profman_bin << ") failed";
@@ -948,7 +948,7 @@ static void run_profman_dump(const std::vector<unique_fd>& profile_fds,
    for (const std::string& profman_arg : profman_args) {
    for (const std::string& profman_arg : profman_args) {
        argv[i++] = profman_arg.c_str();
        argv[i++] = profman_arg.c_str();
    }
    }
    argv[i] = NULL;
    argv[i] = nullptr;


    execv(PROFMAN_BIN, (char * const *)argv);
    execv(PROFMAN_BIN, (char * const *)argv);
    PLOG(ERROR) << "execv(" << PROFMAN_BIN << ") failed";
    PLOG(ERROR) << "execv(" << PROFMAN_BIN << ") failed";
@@ -1308,7 +1308,7 @@ Dex2oatFileWrapper maybe_open_app_image(const char* out_oat_path,
    }
    }
    char app_image_format[kPropertyValueMax];
    char app_image_format[kPropertyValueMax];
    bool have_app_image_format =
    bool have_app_image_format =
            get_property("dalvik.vm.appimageformat", app_image_format, NULL) > 0;
            get_property("dalvik.vm.appimageformat", app_image_format, nullptr) > 0;
    if (!have_app_image_format) {
    if (!have_app_image_format) {
        return Dex2oatFileWrapper();
        return Dex2oatFileWrapper();
    }
    }
@@ -1629,7 +1629,7 @@ static void exec_dexoptanalyzer(const std::string& dex_file, int vdex_fd, int oa
    if (class_loader_context != nullptr) {
    if (class_loader_context != nullptr) {
        argv[i++] = class_loader_context_arg.c_str();
        argv[i++] = class_loader_context_arg.c_str();
    }
    }
    argv[i] = NULL;
    argv[i] = nullptr;


    execv(dexoptanalyzer_bin, (char * const *)argv);
    execv(dexoptanalyzer_bin, (char * const *)argv);
    ALOGE("execv(%s) failed: %s\n", dexoptanalyzer_bin, strerror(errno));
    ALOGE("execv(%s) failed: %s\n", dexoptanalyzer_bin, strerror(errno));
+3 −3
Original line number Original line Diff line number Diff line
@@ -107,7 +107,7 @@ static int initialize_directories() {
        DIR *dir;
        DIR *dir;
        struct dirent *dirent;
        struct dirent *dirent;
        dir = opendir("/data/user");
        dir = opendir("/data/user");
        if (dir != NULL) {
        if (dir != nullptr) {
            while ((dirent = readdir(dir))) {
            while ((dirent = readdir(dir))) {
                const char *name = dirent->d_name;
                const char *name = dirent->d_name;


@@ -146,10 +146,10 @@ static int initialize_directories() {
            closedir(dir);
            closedir(dir);


            if (access(keychain_added_dir, F_OK) == 0) {
            if (access(keychain_added_dir, F_OK) == 0) {
                delete_dir_contents(keychain_added_dir, 1, 0);
                delete_dir_contents(keychain_added_dir, 1, nullptr);
            }
            }
            if (access(keychain_removed_dir, F_OK) == 0) {
            if (access(keychain_removed_dir, F_OK) == 0) {
                delete_dir_contents(keychain_removed_dir, 1, 0);
                delete_dir_contents(keychain_removed_dir, 1, nullptr);
            }
            }
        }
        }


Loading