// Check wheter we have an uninitialized logfile
// or write to the logfile failed
if (!this->isInitialized()
// Check wheter we have an uninitialized logfile
// or write to the logfile failed
if (!this->isInitialized()
- || (write(this->logFd, logline.c_str(), logline.size()) == -1)) {
- // Print message to stderr
- std::cerr << "Could not write to logfile:" << std::endl
+ || (write(this->logFd, logline.c_str(), logline.size()) == -1)) {
+ // Print message to stderr
+ std::cerr << "Could not write to logfile:" << std::endl
throw (IOException) {
// Open logfile in append mode, create if not existing.
this->logFd = ::open(config.getLogfile().c_str(),
throw (IOException) {
// Open logfile in append mode, create if not existing.
this->logFd = ::open(config.getLogfile().c_str(),
}
// Set close-on-exec flag, because we do not want
// the user to write to our logfile
if (::fcntl(this->logFd, F_SETFD, FD_CLOEXEC)) {
}
// Set close-on-exec flag, because we do not want
// the user to write to our logfile
if (::fcntl(this->logFd, F_SETFD, FD_CLOEXEC)) {
- // Ooops, something went wrong
- throw IOException("Could not set close-on-exec flag on logfile",
- __FILE__, __LINE__);
+ // Ooops, something went wrong
+ throw IOException("Could not set close-on-exec flag on logfile",
+ __FILE__, __LINE__);