lowmem-monitor: Check return value of eventfd_write and remove useless code 73/297673/3 accepted/tizen/unified/20230825.044230 accepted/tizen/unified/riscv/20230829.072052
authorUnsung Lee <unsung.lee@samsung.com>
Tue, 22 Aug 2023 11:47:50 +0000 (20:47 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Wed, 23 Aug 2023 02:03:09 +0000 (11:03 +0900)
commit4a43e9784a157f4121a5752779d3e865ea055dba
treef314481f7964df3c4c27ebca993c5dccbee0a1e4
parent6003584af9b1b184ee5b304511abd84820d33456
lowmem-monitor: Check return value of eventfd_write and remove useless code

Check return value of eventfd_write and remove eventfd_read function. This is
because if eventfd_write is not correctly working (return value is -1),
then monitor pthread will not be exited. In addition, eventfd_read is used to
read dummy value, so psi monitor will be exited correctly regardless of eventfd_read.

It solves problems reported by Coverity with cid = 1704480 and cid = 1704688.

Change-Id: Ic753aaf3b96c95d7f1e2e629c165800728b92289
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/resource-limiter/memory/lowmem-monitor-psi.c