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

Commit ac9f33ce authored by Padmanabha V's avatar Padmanabha V
Browse files

Rectify Boottime property



__mount gets called multiple times. Set the read-only property only upon
success since it can't be set multiple times. Selinux disallows modifying
read-only property and therefore the property holds a wrong value, the one
when __mount was called first even in case the call failed.

Bug: 224824099
Signed-off-by: default avatarPadmanabha V <padmanabha.v@sasken.com>
Change-Id: If2900fcf988b6225bb0f96586b00b97386ca8a81
parent addba346
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -840,8 +840,10 @@ static int __mount(const std::string& source, const std::string& target, const F
    if ((ret == 0) && (mountflags & MS_RDONLY) != 0) {
        fs_mgr_set_blk_ro(source);
    }
    if (ret == 0) {
        android::base::SetProperty("ro.boottime.init.mount." + Basename(target),
                                   std::to_string(t.duration().count()));
    }
    errno = save_errno;
    return ret;
}