Unix: Report an error when device is unplugged
Commit c59c317cb8f6c65de6668ba01d61d78feb7d4b9f made sure that we
do not treat read() returning zero as an error, because it generally
is not.
However, read() also returns zero when the device is unplugged. Such
case should be reported as a ResourceError.
This commit introduces a new ExceptionNotifier that it listening for
Exception events. The idea is that if the notifier reported an
exception and read() returns zero, this is an error case, and we
need to report a ResourceError.
The approach was tested with both Glib-based and default Unix
event dispatchers.
Amends c59c317cb8f6c65de6668ba01d61d78feb7d4b9f.
Fixes: QTBUG-133489
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I06a10a6cccbee89014a62aa2c3e4f1941c016b22
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>