forked from enlightenment/efl
efl_io_reader/writer: silent errors when operating on unset-objects.
if we're operating on unset objects, fd are now -1 and would complain, relax that.
This commit is contained in:
parent
4d5105afeb
commit
c152aad8c5
|
@ -76,7 +76,7 @@ _efl_io_reader_fd_efl_io_reader_can_read_get(Eo *o EINA_UNUSED, Efl_Io_Reader_Fd
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_io_reader_fd_efl_io_reader_can_read_set(Eo *o, Efl_Io_Reader_Fd_Data *pd, Eina_Bool can_read)
|
_efl_io_reader_fd_efl_io_reader_can_read_set(Eo *o, Efl_Io_Reader_Fd_Data *pd, Eina_Bool can_read)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_TRUE_RETURN(efl_io_reader_fd_get(o) < 0);
|
EINA_SAFETY_ON_TRUE_RETURN(efl_io_reader_fd_get(o) < 0 && can_read);
|
||||||
if (pd->can_read == can_read) return;
|
if (pd->can_read == can_read) return;
|
||||||
pd->can_read = can_read;
|
pd->can_read = can_read;
|
||||||
efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
|
efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
|
||||||
|
@ -91,7 +91,7 @@ _efl_io_reader_fd_efl_io_reader_eos_get(Eo *o EINA_UNUSED, Efl_Io_Reader_Fd_Data
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_io_reader_fd_efl_io_reader_eos_set(Eo *o, Efl_Io_Reader_Fd_Data *pd, Eina_Bool is_eos)
|
_efl_io_reader_fd_efl_io_reader_eos_set(Eo *o, Efl_Io_Reader_Fd_Data *pd, Eina_Bool is_eos)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_TRUE_RETURN(efl_io_reader_fd_get(o) < 0);
|
EINA_SAFETY_ON_TRUE_RETURN(efl_io_reader_fd_get(o) < 0 && !is_eos);
|
||||||
if (pd->eos == is_eos) return;
|
if (pd->eos == is_eos) return;
|
||||||
pd->eos = is_eos;
|
pd->eos = is_eos;
|
||||||
if (is_eos)
|
if (is_eos)
|
||||||
|
|
|
@ -80,7 +80,7 @@ _efl_io_writer_fd_efl_io_writer_can_write_get(Eo *o EINA_UNUSED, Efl_Io_Writer_F
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_io_writer_fd_efl_io_writer_can_write_set(Eo *o, Efl_Io_Writer_Fd_Data *pd, Eina_Bool can_write)
|
_efl_io_writer_fd_efl_io_writer_can_write_set(Eo *o, Efl_Io_Writer_Fd_Data *pd, Eina_Bool can_write)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_TRUE_RETURN(efl_io_writer_fd_get(o) < 0);
|
EINA_SAFETY_ON_TRUE_RETURN(efl_io_writer_fd_get(o) < 0 && can_write);
|
||||||
if (pd->can_write == can_write) return;
|
if (pd->can_write == can_write) return;
|
||||||
pd->can_write = can_write;
|
pd->can_write = can_write;
|
||||||
efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
|
efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
|
||||||
|
|
Loading…
Reference in New Issue