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

Commit e397bb6c authored by Mark Salyzyn's avatar Mark Salyzyn Committed by android-build-merger
Browse files

Merge "fs_mgr: correct error handling" am: 16c87027 am: 24cddf17

am: 6d9cd77f

Change-Id: I527fd38e28fe6b3de88d218fbf2d5a4c4c3b52ab
parents 2bc5f0b3 6d9cd77f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -163,7 +163,9 @@ bool fs_mgr_wants_overlayfs() {
    // Overlayfs available in the kernel, and patched for override_creds?
    static signed char overlayfs_in_kernel = -1;  // cache for constant condition
    if (overlayfs_in_kernel == -1) {
        auto save_errno = errno;
        overlayfs_in_kernel = !access("/sys/module/overlay/parameters/override_creds", F_OK);
        errno = save_errno;
    }
    return overlayfs_in_kernel;
}
@@ -429,7 +431,7 @@ bool fs_mgr_overlayfs_teardown(const char* mount_point, bool* change) {
    const auto newpath = oldpath + ".teardown";
    ret &= fs_mgr_rm_all(newpath);
    auto save_errno = errno;
    if (rename(oldpath.c_str(), newpath.c_str())) {
    if (!rename(oldpath.c_str(), newpath.c_str())) {
        if (change) *change = true;
    } else if (errno != ENOENT) {
        ret = false;