~aleteoryx/muditaos

b419649f7fc2907cc87488429fc4e9f0f8eb95c8 — Lucjan Bryndza 4 years ago 8ea8626
[EGD-6590] Add /mfgconf mount to iosyscalls lib

Add translation of the /mfgconf mount point in the libiosyscall
library when redirection is disabled.
1 files changed, 6 insertions(+), 2 deletions(-)

M board/linux/libiosyscalls/src/iosyscalls.cpp
M board/linux/libiosyscalls/src/iosyscalls.cpp => board/linux/libiosyscalls/src/iosyscalls.cpp +6 -2
@@ 31,7 31,7 @@ namespace
                                        "/tmp",
                                        nullptr};

    constexpr const char *IMAGE_PATHS[]{"/sys", "assets", "country-codes.db", "Luts.bin", nullptr};
    constexpr const char *IMAGE_PATHS[]{"/sys", "/mfgconf", "assets", "country-codes.db", "Luts.bin", nullptr};

    pthread_mutex_t g_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
    phmap::flat_hash_set<vfsn::linux::internal::FILEX *> g_fdlist;


@@ 66,7 66,11 @@ namespace vfsn::linux::internal
    {
        for (auto path = IMAGE_PATHS; *path; ++path)
            if (std::strstr(inpath, *path) == inpath) {
                if (*inpath == '/') {
                if (!std::strcmp(*path, "/mfgconf")) {
                    std::strncpy(buffer, "sys/", PATH_MAX);
                    std::strncpy(buffer + 3, inpath + 8, PATH_MAX - 3);
                }
                else if (*inpath == '/') {
                    std::strncpy(buffer, inpath + 1, PATH_MAX);
                }
                else {