Changes: Code clean-up

RevBy: TrustMe
pull/1/head
Alexey Shilov 14 years ago
parent d78f860bd3
commit c97599ae9c

@ -24,6 +24,7 @@
#include <unistd.h>
#include <string.h>
#include "report.h"
#include "search.h"
static char* merge_paths(const char *base_path, const char *rel_path)

@ -179,25 +179,6 @@ bool Connection::recvMsg(uint32_t *msg)
}
}
bool Connection::sendStr(const char * str)
{
if (!m_testMode)
{
// Send size.
uint32_t size = strlen(str) + 1;
sendMsg(size);
Logger::logDebug("Connection: %s: '%s'", __FUNCTION__, str);
// Send the string.
return write(m_fd, str, size) != -1;
}
else
{
return true;
}
}
const char * Connection::recvStr()
{
if (!m_testMode)

@ -143,9 +143,6 @@ private:
//! Receive a message from a socket. This is a virtual to help unit testing.
virtual bool recvMsg(uint32_t *msg);
//! Send a string. This is a virtual to help unit testing.
virtual bool sendStr(const char * str);
//! Receive a string. This is a virtual to help unit testing.
virtual const char * recvStr();

@ -602,6 +602,7 @@ void Daemon::daemonize()
}
// Check the lock
// Note: file locking must be done after forking, otherwise lock belongs to parent process
if(!Daemon::lock())
throw std::runtime_error(std::string(PROG_NAME_LAUNCHER) + " is already running\n");

Loading…
Cancel
Save