ADD_DEFINITIONS("-DBUILD_WITH_SYSTEMD")
ENDIF (BUILD_WITH_SYSTEMD)
+IF (CYNARA_NO_LOGS)
+ ADD_DEFINITIONS("-DCYNARA_NO_LOGS")
+ENDIF (CYNARA_NO_LOGS)
+
SET(TARGET_CYNARA "cynara")
SET(TARGET_LIB_CYNARA "cynara-client")
SET(TARGET_LIB_CYNARA_ASYNC "cynara-client-async")
#include <dlfcn.h>
#include <functional>
+#include <attributes/attributes.h>
#include <exceptions/UnknownPolicyTypeException.h>
#include <log/log.h>
int fileAmount = scandir(m_dir.c_str(), &nameList, pluginFilter, alphasort);
if (fileAmount < 0) {
- auto error = strerror(errno);
- LOGE("Couldn't scan for plugins in <%s> : <%s>", m_dir.c_str(), error);
+ UNUSED int err = errno;
+ LOGE("Couldn't scan for plugins in <%s> : <%s>", m_dir.c_str(), strerror(err));
return;
}
#include <systemd/sd-daemon.h>
#endif
+#include <attributes/attributes.h>
#include <log/log.h>
#include <common.h>
#include <config/PathConfig.h>
unsigned int clientLen = sizeof(clientAddr);
int clientFd = accept4(fd, (struct sockaddr*) &clientAddr, &clientLen, SOCK_NONBLOCK);
if (clientFd == -1) {
- int err = errno;
+ UNUSED int err = errno;
LOGW("Error in accept on socket [%d]: <%s>", fd, strerror(err));
return;
}
int fd;
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
- int err = errno;
+ UNUSED int err = errno;
LOGE("Error during UNIX socket creation: <%s>", strerror(err));
throw InitException();
}
if ((flags = fcntl(fd, F_GETFL, 0)) == -1)
flags = 0;
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) {
- int err = errno;
+ UNUSED int err = errno;
close(fd);
LOGE("Error setting \"O_NONBLOCK\" on descriptor [%d] with fcntl: <%s>",
fd, strerror(err));
originalUmask = umask(mask);
if (bind(fd, (struct sockaddr*)&serverAddress, sizeof(serverAddress)) == -1) {
- int err = errno;
+ UNUSED int err = errno;
close(fd);
LOGE("Error in bind socket descriptor [%d] to path <%s>: <%s>",
fd, path.c_str(), strerror(err));
umask(originalUmask);
if (listen(fd, 5) == -1) {
- int err = errno;
+ UNUSED int err = errno;
close(fd);
LOGE("Error setting listen on file descriptor [%d], path <%s>: <%s>",
fd, path.c_str(), strerror(err));