mirror of
				https://github.com/pocoproject/poco.git
				synced 2025-10-25 18:22:59 +02: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:
		| @@ -166,12 +166,12 @@ protected: | |||||||
| #endif | #endif | ||||||
|  |  | ||||||
| private: | private: | ||||||
|  | 	virtual void handlePidFile(const std::string& name, const std::string& value); | ||||||
| #if defined(POCO_VXWORKS) | #if defined(POCO_VXWORKS) | ||||||
| 	static Poco::Event _terminate; | 	static Poco::Event _terminate; | ||||||
| #elif defined(POCO_OS_FAMILY_UNIX) | #elif defined(POCO_OS_FAMILY_UNIX) | ||||||
| 	void handleDaemon(const std::string& name, const std::string& value); | 	void handleDaemon(const std::string& name, const std::string& value); | ||||||
| 	void handleUMask(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); | 	bool isDaemon(int argc, char** argv); | ||||||
| 	void beDaemon(); | 	void beDaemon(); | ||||||
| #if POCO_OS == POCO_OS_ANDROID | #if POCO_OS == POCO_OS_ANDROID | ||||||
|   | |||||||
| @@ -16,6 +16,7 @@ | |||||||
| #include "Poco/Util/Option.h" | #include "Poco/Util/Option.h" | ||||||
| #include "Poco/Util/OptionSet.h" | #include "Poco/Util/OptionSet.h" | ||||||
| #include "Poco/Util/OptionException.h" | #include "Poco/Util/OptionException.h" | ||||||
|  | #include "Poco/TemporaryFile.h" | ||||||
| #include "Poco/FileStream.h" | #include "Poco/FileStream.h" | ||||||
| #include "Poco/Exception.h" | #include "Poco/Exception.h" | ||||||
| #if !defined(POCO_VXWORKS) | #if !defined(POCO_VXWORKS) | ||||||
| @@ -26,7 +27,6 @@ | |||||||
| #include "Poco/Logger.h" | #include "Poco/Logger.h" | ||||||
| #include "Poco/String.h" | #include "Poco/String.h" | ||||||
| #if defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_VXWORKS) | #if defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_VXWORKS) | ||||||
| #include "Poco/TemporaryFile.h" |  | ||||||
| #include <stdlib.h> | #include <stdlib.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
| #include <stdio.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) | void ServerApplication::handlePidFile(const std::string& name, const std::string& value) | ||||||
| { | { | ||||||
| 	Poco::FileOutputStream ostr(value); | 	Poco::FileOutputStream ostr(value); | ||||||
| @@ -717,7 +720,4 @@ void ServerApplication::handlePidFile(const std::string& name, const std::string | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
|  |  | ||||||
| } } // namespace Poco::Util | } } // namespace Poco::Util | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Pavle Dragisic
					Pavle Dragisic