printout fixes for UnixFileGuard #468

Merged
muellerr merged 5 commits from eive/fsfw:mueller/unix-file-guard-fix into development 2021-09-13 15:10:00 +02:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit b6aebb3061 - Show all commits

View File

@ -15,10 +15,10 @@ UnixFileGuard::UnixFileGuard(std::string device, int* fileDescriptor, int flags,
if (*fileDescriptor < 0) {
#if FSFW_VERBOSE_LEVEL >= 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << diagnosticPrefix << "Opening device failed with error code " <<
sif::warning << diagnosticPrefix << ": Opening device failed with error code " <<
errno << ": " << strerror(errno) << std::endl;
#else
sif::printWarning("%sOpening device failed with error code %d: %s\n",
sif::printWarning("%s: Opening device failed with error code %d: %s\n",
muellerr marked this conversation as resolved Outdated

Shouldn't there be a space between diagnosticPrefix and "Opening..." ?

Shouldn't there be a space between diagnosticPrefix and "Opening..." ?

Maybe this and a colon would be more clean. Then it needs to be adapted for the ostream implementation as well and some calling code needs to be adapted

Maybe this and a colon would be more clean. Then it needs to be adapted for the ostream implementation as well and some calling code needs to be adapted
diagnosticPrefix, errno, strerror(errno));
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
#endif /* FSFW_VERBOSE_LEVEL >= 1 */

View File

@ -184,7 +184,7 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie *spiCookie, const
/* Prepare transfer */
int fileDescriptor = 0;
std::string device = spiCookie->getSpiDevice();
UnixFileGuard fileHelper(device, &fileDescriptor, O_RDWR, "SpiComIF::sendMessage: ");
UnixFileGuard fileHelper(device, &fileDescriptor, O_RDWR, "SpiComIF::sendMessage");
if(fileHelper.getOpenResult() != HasReturnvaluesIF::RETURN_OK) {
return OPENING_FILE_FAILED;
}
@ -273,7 +273,7 @@ ReturnValue_t SpiComIF::performHalfDuplexReception(SpiCookie* spiCookie) {
std::string device = spiCookie->getSpiDevice();
int fileDescriptor = 0;
UnixFileGuard fileHelper(device, &fileDescriptor, O_RDWR,
"SpiComIF::requestReceiveMessage: ");
"SpiComIF::requestReceiveMessage");
if(fileHelper.getOpenResult() != HasReturnvaluesIF::RETURN_OK) {
return OPENING_FILE_FAILED;
}