mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-22 05:33:32 +01:00
Virtualize ServerApplication::handlePidFile() (#4223)
* feat(OptionSet): Add replaceOption() #4181 * revert changes #4181 * feat: make ServerApplication::handlePidFile virtual #4181 * move handlePidFile() out of ifdef #4181 * fix(ServerApplication): move handlePidFile() out of all ifdefs #4181 --------- Co-authored-by: Pavle <pavle@debian-gnu-linux-11.localdomain> Co-authored-by: Aleksandar Fabijanic <aleks-f@users.noreply.github.com>
This commit is contained in:
parent
39e35c316d
commit
f30d759c08
@ -166,12 +166,12 @@ protected:
|
||||
#endif
|
||||
|
||||
private:
|
||||
virtual void handlePidFile(const std::string& name, const std::string& value);
|
||||
#if defined(POCO_VXWORKS)
|
||||
static Poco::Event _terminate;
|
||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
||||
void handleDaemon(const std::string& name, const std::string& value);
|
||||
void handleUMask(const std::string& name, const std::string& value);
|
||||
void handlePidFile(const std::string& name, const std::string& value);
|
||||
bool isDaemon(int argc, char** argv);
|
||||
void beDaemon();
|
||||
#if POCO_OS == POCO_OS_ANDROID
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "Poco/Util/Option.h"
|
||||
#include "Poco/Util/OptionSet.h"
|
||||
#include "Poco/Util/OptionException.h"
|
||||
#include "Poco/TemporaryFile.h"
|
||||
#include "Poco/FileStream.h"
|
||||
#include "Poco/Exception.h"
|
||||
#if !defined(POCO_VXWORKS)
|
||||
@ -26,7 +27,6 @@
|
||||
#include "Poco/Logger.h"
|
||||
#include "Poco/String.h"
|
||||
#if defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_VXWORKS)
|
||||
#include "Poco/TemporaryFile.h"
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
@ -706,6 +706,9 @@ void ServerApplication::handleUMask(const std::string& name, const std::string&
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void ServerApplication::handlePidFile(const std::string& name, const std::string& value)
|
||||
{
|
||||
Poco::FileOutputStream ostr(value);
|
||||
@ -717,7 +720,4 @@ void ServerApplication::handlePidFile(const std::string& name, const std::string
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
} } // namespace Poco::Util
|
||||
|
Loading…
x
Reference in New Issue
Block a user