mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:03:53 +02:00
Merge pull request #899 from ey6es/master
Fix for compile warnings on Linux: check return values on read/write.
This commit is contained in:
commit
f0bb42a988
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