mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-17 22:08:27 +02:00
Fix for compile warnings on Linux: check return values on read/write.
This commit is contained in:
parent
2aaff63b32
commit
843d5656bd
1 changed files with 8 additions and 2 deletions
|
@ -125,9 +125,15 @@ void SerialInterface::initializePort(char* portname) {
|
|||
tcflush(_serialDescriptor, TCIOFLUSH);
|
||||
|
||||
// this disables streaming so there's no garbage data on reads
|
||||
write(_serialDescriptor, "SD\n", 3);
|
||||
if (write(_serialDescriptor, "SD\n", 3) != 3) {
|
||||
qDebug("Failed.\n");
|
||||
return;
|
||||
}
|
||||
char result[4];
|
||||
read(_serialDescriptor, result, 4);
|
||||
if (read(_serialDescriptor, result, 4) != 4) {
|
||||
qDebug("Failed.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
tty_set_file_descriptor(_serialDescriptor);
|
||||
mpu_init(0);
|
||||
|
|
Loading…
Reference in a new issue