Fix GCC warnings on Linux.

This commit is contained in:
Prcuvu
2015-10-08 12:51:28 +08:00
parent f441d3a6f7
commit d98a25797e
6 changed files with 22 additions and 14 deletions
+6 -2
View File
@@ -24,7 +24,7 @@ LightsDriver_Linux_PIUIO::LightsDriver_Linux_PIUIO()
fd = open("/dev/piuio0", O_WRONLY);
if( fd < 0 )
{
LOG->Warn( "Error opening serial port for lights. Error:: %d %s", errno, strerror(errno) );
LOG->Warn( "Error opening serial port for lights. Error: %d %s", errno, strerror(errno) );
return;
}
LOG->Info("Opened PIUIO device for lights");
@@ -75,7 +75,11 @@ void LightsDriver_Linux_PIUIO::Set( const LightsState *ls )
return;
memcpy(oldbuf, buf, 8);
write(fd, buf, 8);
if (write(fd, buf, 8) != 8)
{
LOG->Warn( "Error setting lights state. Error: %d %s", errno, strerror(errno) );
return;
}
}
/*