linux fixes
This commit is contained in:
parent
36bc7609c5
commit
7129ea67bd
@ -1,10 +1,11 @@
|
|||||||
#include "BinarySemaphore.h"
|
#include "BinarySemaphore.h"
|
||||||
|
#include "../../serviceinterface/ServiceInterfacePrinter.h"
|
||||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||||
|
|
||||||
extern "C" {
|
#include <time.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
}
|
|
||||||
|
|
||||||
BinarySemaphore::BinarySemaphore() {
|
BinarySemaphore::BinarySemaphore() {
|
||||||
// Using unnamed semaphores for now
|
// Using unnamed semaphores for now
|
||||||
@ -113,7 +114,8 @@ uint8_t BinarySemaphore::getSemaphoreCounter(sem_t *handle) {
|
|||||||
}
|
}
|
||||||
else if(result != 0 and errno == EINVAL) {
|
else if(result != 0 and errno == EINVAL) {
|
||||||
// Could be called from interrupt, use lightweight printf
|
// Could be called from interrupt, use lightweight printf
|
||||||
printf("BinarySemaphore::getSemaphoreCounter: Invalid semaphore\n");
|
fsfw::printError("BinarySemaphore::getSemaphoreCounter: "
|
||||||
|
"Invalid semaphore\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -128,13 +130,17 @@ void BinarySemaphore::initSemaphore(uint8_t initCount) {
|
|||||||
switch(errno) {
|
switch(errno) {
|
||||||
case(EINVAL):
|
case(EINVAL):
|
||||||
// Value exceeds SEM_VALUE_MAX
|
// Value exceeds SEM_VALUE_MAX
|
||||||
case(ENOSYS):
|
case(ENOSYS): {
|
||||||
// System does not support process-shared semaphores
|
// System does not support process-shared semaphores
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "BinarySemaphore: Init failed with" << strerror(errno)
|
sif::error << "BinarySemaphore: Init failed with "
|
||||||
<< std::endl;
|
<< strerror(errno) << std::endl;
|
||||||
|
#else
|
||||||
|
fsfw::printError("BinarySemaphore: Init failed with %s\n",
|
||||||
|
strerror(errno));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#include "../../osal/linux/CountingSemaphore.h"
|
#include "../../osal/linux/CountingSemaphore.h"
|
||||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
#include "../../serviceinterface/ServiceInterface.h"
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
CountingSemaphore::CountingSemaphore(const uint8_t maxCount, uint8_t initCount):
|
CountingSemaphore::CountingSemaphore(const uint8_t maxCount, uint8_t initCount):
|
||||||
maxCount(maxCount), initCount(initCount) {
|
maxCount(maxCount), initCount(initCount) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "MessageQueue.h"
|
#include "MessageQueue.h"
|
||||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
#include "../../serviceinterface/ServiceInterface.h"
|
||||||
#include "../../objectmanager/ObjectManagerIF.h"
|
#include "../../objectmanager/ObjectManagerIF.h"
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
@ -121,14 +121,16 @@ ReturnValue_t MessageQueue::handleError(mq_attr* attributes,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default: {
|
||||||
// Failed either the first time or the second time
|
// Failed either the first time or the second time
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "MessageQueue::MessageQueue: Creating Queue " << std::hex
|
sif::error << "MessageQueue::MessageQueue: Creating Queue " << name
|
||||||
<< name << std::dec << " failed with status: "
|
<< " failed with status: " << strerror(errno) << std::endl;
|
||||||
<< strerror(errno) << std::endl;
|
#else
|
||||||
|
fsfw::printError("MessageQueue::MessageQueue: Creating Queue %s"
|
||||||
|
" failed with status: %s\n", name, strerror(errno));
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include "TcUnixUdpPollingTask.h"
|
#include "TcUnixUdpPollingTask.h"
|
||||||
#include "../../globalfunctions/arrayprinter.h"
|
#include "../../globalfunctions/arrayprinter.h"
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
TcUnixUdpPollingTask::TcUnixUdpPollingTask(object_id_t objectId,
|
TcUnixUdpPollingTask::TcUnixUdpPollingTask(object_id_t objectId,
|
||||||
object_id_t tmtcUnixUdpBridge, size_t frameSize,
|
object_id_t tmtcUnixUdpBridge, size_t frameSize,
|
||||||
double timeoutSeconds): SystemObject(objectId),
|
double timeoutSeconds): SystemObject(objectId),
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "TmTcUnixUdpBridge.h"
|
#include "TmTcUnixUdpBridge.h"
|
||||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
#include "../../serviceinterface/ServiceInterface.h"
|
||||||
#include "../../ipc/MutexHelper.h"
|
#include "../../ipc/MutexHelper.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -188,12 +188,16 @@ void TmTcUnixUdpBridge::handleBindError() {
|
|||||||
|
|
||||||
void TmTcUnixUdpBridge::handleSendError() {
|
void TmTcUnixUdpBridge::handleSendError() {
|
||||||
switch(errno) {
|
switch(errno) {
|
||||||
default:
|
default: {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "TmTcUnixBridge::handleSendError: "
|
sif::error << "TmTcUnixBridge::handleSendError: "
|
||||||
<< strerror(errno) << std::endl;
|
<< strerror(errno) << std::endl;
|
||||||
|
#else
|
||||||
|
fsfw::printError("TmTcUnixBridge::handleSendError: %s\n",
|
||||||
|
strerror(errno));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TmTcUnixUdpBridge::setClientAddressToAny(bool ipAddrAnySet){
|
void TmTcUnixUdpBridge::setClientAddressToAny(bool ipAddrAnySet){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user