I think Robin meant a nested do..while loop. So something like:

```
do {
	do {
		iFd = open( iDevice.toLatin1().constData(), O_RDWR | O_NOCTTY | O_SYNC );
	} while (iFd == -1 && errno == EINTR);
	if (iFd > 0) break;
	QThread::msleep (100); // Sleep for 100msec before trying again
} while ((--retryCount > 0) && (iFd == -1));
```