Merge "Clarify the fcntl() "that's not how F_SETFD works" error." into main am: b4e2219987

Original change: https://android-review.googlesource.com/c/platform/bionic/+/2780900

Change-Id: I24088e1c91afc29509177e7d6c44ce913e2eaa9b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Elliott Hughes 2023-10-12 18:23:14 +00:00 committed by Automerger Merge Worker
commit dfb9662b24
2 changed files with 2 additions and 2 deletions

View file

@ -44,7 +44,7 @@ int fcntl(int fd, int cmd, ...) {
va_end(args);
if (cmd == F_SETFD && (reinterpret_cast<uintptr_t>(arg) & ~FD_CLOEXEC) != 0) {
__fortify_fatal("fcntl(F_SETFD) passed non-FD_CLOEXEC flag: %p", arg);
__fortify_fatal("fcntl(F_SETFD) only supports FD_CLOEXEC but was passed %p", arg);
}
#if defined(__LP64__)

View file

@ -363,5 +363,5 @@ TEST(fcntl, open_O_TMPFILE_mode) {
}
TEST_F(fcntl_DeathTest, fcntl_F_SETFD) {
EXPECT_DEATH(fcntl(0, F_SETFD, O_NONBLOCK), "non-FD_CLOEXEC");
EXPECT_DEATH(fcntl(0, F_SETFD, O_NONBLOCK), "only supports FD_CLOEXEC");
}