From c152aad8c5770b0ba260e398680ccdade96d3128 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Mon, 19 Dec 2016 21:59:57 -0200 Subject: [PATCH] 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. --- src/lib/ecore/efl_io_reader_fd.c | 4 ++-- src/lib/ecore/efl_io_writer_fd.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/ecore/efl_io_reader_fd.c b/src/lib/ecore/efl_io_reader_fd.c index a1f9931..e499009 100644 --- a/src/lib/ecore/efl_io_reader_fd.c +++ b/src/lib/ecore/efl_io_reader_fd.c @@ -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 _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; pd->can_read = can_read; 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 _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; pd->eos = is_eos; if (is_eos) diff --git a/src/lib/ecore/efl_io_writer_fd.c b/src/lib/ecore/efl_io_writer_fd.c index d337f7b..6540d65 100644 --- a/src/lib/ecore/efl_io_writer_fd.c +++ b/src/lib/ecore/efl_io_writer_fd.c @@ -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 _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; pd->can_write = can_write; efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL); -- 2.7.4