Avoid confusing "read prevented write" log messages.
Moving to a "function: message" style avoids ambiguity.
Change-Id: If9d590e50265c61725d3673bd03796e65edd2d5e
diff --git a/libc/bionic/__FD_chk.cpp b/libc/bionic/__FD_chk.cpp
index 5c2338d..af8427a 100644
--- a/libc/bionic/__FD_chk.cpp
+++ b/libc/bionic/__FD_chk.cpp
@@ -32,39 +32,39 @@
extern "C" int __FD_ISSET_chk(int fd, fd_set* set, size_t set_size) {
if (__predict_false(fd < 0)) {
- __fortify_chk_fail("file descriptor is negative for FD_ISSET", 0);
+ __fortify_chk_fail("FD_ISSET: file descriptor < 0", 0);
}
if (__predict_false(fd >= FD_SETSIZE)) {
- __fortify_chk_fail("file descriptor is too big for FD_ISSET", 0);
+ __fortify_chk_fail("FD_ISSET: file descriptor >= FD_SETSIZE", 0);
}
if (__predict_false(set_size < sizeof(fd_set))) {
- __fortify_chk_fail("set is too small", 0);
+ __fortify_chk_fail("FD_ISSET: set is too small", 0);
}
return FD_ISSET(fd, set);
}
extern "C" void __FD_CLR_chk(int fd, fd_set* set, size_t set_size) {
if (__predict_false(fd < 0)) {
- __fortify_chk_fail("file descriptor is negative for FD_CLR", 0);
+ __fortify_chk_fail("FD_CLR: file descriptor < 0", 0);
}
if (__predict_false(fd >= FD_SETSIZE)) {
- __fortify_chk_fail("file descriptor is too big for FD_CLR", 0);
+ __fortify_chk_fail("FD_CLR: file descriptor >= FD_SETSIZE", 0);
}
if (__predict_false(set_size < sizeof(fd_set))) {
- __fortify_chk_fail("set is too small", 0);
+ __fortify_chk_fail("FD_CLR: set is too small", 0);
}
FD_CLR(fd, set);
}
extern "C" void __FD_SET_chk(int fd, fd_set* set, size_t set_size) {
if (__predict_false(fd < 0)) {
- __fortify_chk_fail("file descriptor is negative for FD_SET", 0);
+ __fortify_chk_fail("FD_SET: file descriptor < 0", 0);
}
if (__predict_false(fd >= FD_SETSIZE)) {
- __fortify_chk_fail("file descriptor is too big for FD_SET", 0);
+ __fortify_chk_fail("FD_SET: file descriptor >= FD_SETSIZE", 0);
}
if (__predict_false(set_size < sizeof(fd_set))) {
- __fortify_chk_fail("set is too small", 0);
+ __fortify_chk_fail("FD_SET: set is too small", 0);
}
FD_SET(fd, set);
}