-
Petri Latvala authored
testdisplay uses GIO for polling the udev fd for events. When shutting down, both the GIO channel and libudev want to close their respective fds, leading to a double close. Since version 240 (as used by Ubuntu 19.04), libudev has complained loudly if close() fails with EBADF. Previously the error has flown under the radar. Calling g_io_channel_shutdown() will call close() on the fd regardless of g_io_channel_set_close_on_unref, so opencode the flush and unref instead to avoid double closing. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Jani Saarinen <jani.saarinen@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Tested-by: Jani Saarinen <jani.saarinen@intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>