You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
falk-werner_webfuse/test-src/integration/webfuse/test/daemon.cpp

38 lines
505 B

#include "webfuse/test/daemon.hpp"
#include <limits.h>
#include <unistd.h>
#include <libgen.h>
#include <csignal>
namespace
{
std::string get_executable_path()
{
char directory[PATH_MAX] = { '\0' };
readlink("/proc/self/exe", directory, PATH_MAX);
dirname(directory);
return std::string(directory) + "/webfuse";
}
}
namespace webfuse
{
daemon::daemon(std::string const & mountpoint)
: p({get_executable_path(), "-f", mountpoint})
{
}
daemon::~daemon()
{
p.kill(SIGINT);
}
}