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>
commita9206ddefa5650846484b506c863288e08d70fbc
parent92cde31f7819bf81ddd6743be1353d0ea56390e0
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeMon, 28 Jul 2025 14:00:19 +0200