forked from enlightenment/efl
ecore_signal: check the return value of write(2)
Some glibc declare write(2) with the attribute warn unused result. So we now ensure that the calls to write(2) are successful. Otherwise, we print an error and update errno accordingly.
This commit is contained in:
parent
7ff60afe5c
commit
87efca57ef
|
@ -159,7 +159,12 @@ _ecore_signal_callback(int sig, siginfo_t *si, void *foo EINA_UNUSED)
|
||||||
if (sdata.sig >= 0)
|
if (sdata.sig >= 0)
|
||||||
{
|
{
|
||||||
int err = errno;
|
int err = errno;
|
||||||
write(sig_pipe[1], &sdata, sizeof(sdata));
|
const ssize_t bytes = write(sig_pipe[1], &sdata, sizeof(sdata));
|
||||||
|
if (EINA_UNLIKELY(bytes != sizeof(sdata)))
|
||||||
|
{
|
||||||
|
err = errno;
|
||||||
|
ERR("write() failed: %s", strerror(err));
|
||||||
|
}
|
||||||
errno = err;
|
errno = err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue