unlink(fifo_path);
return -1;
}
- read(fifo_pollfd.fd, buf, sizeof(buf));
+ ret = read(fifo_pollfd.fd, buf, sizeof(buf));
+ if (ret < 0)
+ DEVERR("read() failed (%d)", ret);
fifo_fd = fifo_pollfd.fd;
API int display_cancel_postjob(void)
{
char buf[PATH_MAX];
- int ret;
+ int ret, disp;
snprintf(buf, PATH_MAX, "%s.%d", DISPLAY_WD_FIFO, getpid());
if (access(buf, F_OK) != 0) {
DEVLOG("fifo file path is %s", buf);
return -1;
}
- ret = DISPLAY_WD_CANCEL;
- write(fifo_fd, &ret, sizeof(int));
+ disp = DISPLAY_WD_CANCEL;
+ ret = write(fifo_fd, &disp, sizeof(int));
+ if (ret <= 0)
+ DEVERR("write() failed (%d)", ret);
close(fifo_fd);
unlink(buf);
fifo_fd = -1;
int main(void)
{
- int fd = -1;
+ int r = -1;
int ret = -1;
int val = -1;
int auto_brightness_state = -1;
return -1;
}
if (fifo_pollfd.revents & POLLIN) {
- read(fifo_pollfd.fd, &ret, sizeof(int));
+ r = read(fifo_pollfd.fd, &ret, sizeof(int));
+ if (r < 0)
+ DEVERR("read() failed(%d)", r);
if (ret == DISPLAY_WD_CANCEL) {
DEVERR("[DISPLAY_WD] Canceled. - %s, %d", fifo_path, ret);
close(fifo_pollfd.fd);