libcutils: Fix -Wtautological-constant-out-of-range-compare
The TEMP_FAILURE_RETRY macro was being used with a boolean expression,
which caused a tautological-constant-out-of-range-compare warning.
This change moves the comparison outside of the macro to fix the
warning.
Generated by Gemini.
system/core/libcutils/ashmem-dev.cpp:253:9: error: result of comparison of constant -1 with expression of type bool is always false [-Werror,-Wtautological-constant-out-of-range-compare]
253 | TEMP_FAILURE_RETRY(ioctl(fd, ASHMEM_SET_NAME, name) < 0) ||
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bionic/libc/include/unistd.h:468:18: note: expanded from macro 'TEMP_FAILURE_RETRY'
468 | } while (_rc == -1 && errno == EINTR); \
| ~~~ ^ ~~
Bug: 72331526
Test: presubmit
Flag: EXEMPT, code cleanup
Change-Id: I78b714c991bc60dc6ed1051c4165d2c3cb5ccecd
Loading
Please register or sign in to comment