Don't let missing Treble property context files affect errno.
User code on a non-treble device was starting with errno == ENOENT rather than 0 because of this treble support: openat(AT_FDCWD, "/property_contexts", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) faccessat(AT_FDCWD, "/system/etc/selinux/plat_property_contexts", R_OK) = -1 ENOENT (No such file or directory) This caused us to fail some toybox tests by reporting bogus errno values where errno should have been left unset: PASS: date -d @0 FAIL: date -d @0x123 echo -ne '' | TZ=UTC date -d @0x123 2>&1 --- expected +++ actual @@ -1 +1 @@ -date: bad date '@0x123' +date: bad date '@0x123': No such file or directory PASS: date -d 06021234 PASS: date -d 060212341982 FAIL: date -d 123 echo -ne '' | TZ=UTC date -d 123 2>&1 --- expected +++ actual @@ -1 +1 @@ -date: bad date '123' +date: bad date '123': No such file or directory PASS: date -d 1110143115.30 PASS: date -d 111014312015.30 PASS: date Unix time missing @ Bug: http://b/37248982 Test: ran tests (cherry picked from commit 7ade61ca) Change-Id: I4c680da14f3df16dc5a9884071e48f3221ad3b3b
Loading
Please sign in to comment