22 lines
646 B
C++
22 lines
646 B
C++
|
#include <fsfw_hal/linux/utility.h>
|
||
|
|
||
|
void utility::handleIoctlError(const char* const customPrintout) {
|
||
|
#if FSFW_VERBOSE_LEVEL >= 1
|
||
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||
|
if(customPrintout != nullptr) {
|
||
|
sif::warning << customPrintout << std::endl;
|
||
|
}
|
||
|
sif::warning << "handleIoctlError: Error code " << errno << ", "<< strerror(errno) <<
|
||
|
std::endl;
|
||
|
#else
|
||
|
if(customPrintout != nullptr) {
|
||
|
sif::printWarning("%s\n", customPrintout);
|
||
|
}
|
||
|
sif::printWarning("handleIoctlError: Error code %d, %s\n", errno, strerror(errno));
|
||
|
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
||
|
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
|
||
|
|
||
|
}
|
||
|
|
||
|
|