From cd7f6b7f0e25b5eb7b9d196adf0e9f44014e46fe Mon Sep 17 00:00:00 2001 From: Robert Schulze Date: Tue, 14 Feb 2023 22:10:22 +0000 Subject: [PATCH] Remove qnx --- .../Foundation/include/Poco/FPEnvironment.h | 2 - base/poco/Foundation/include/Poco/Platform.h | 3 - .../poco/Foundation/include/Poco/StreamUtil.h | 3 - base/poco/Foundation/src/FPEnvironment.cpp | 2 - base/poco/Foundation/src/Process_UNIX.cpp | 57 ------------------- 5 files changed, 67 deletions(-) diff --git a/base/poco/Foundation/include/Poco/FPEnvironment.h b/base/poco/Foundation/include/Poco/FPEnvironment.h index 0cc40e21041..62f96b76730 100644 --- a/base/poco/Foundation/include/Poco/FPEnvironment.h +++ b/base/poco/Foundation/include/Poco/FPEnvironment.h @@ -27,8 +27,6 @@ # include "Poco/FPEnvironment_DEC.h" #elif defined(sun) || defined(__sun) # include "Poco/FPEnvironment_SUN.h" -#elif defined(__QNX__) -# include "Poco/FPEnvironment_QNX.h" #elif defined(POCO_OS_FAMILY_UNIX) # include "Poco/FPEnvironment_C99.h" #elif defined(POCO_OS_FAMILY_WINDOWS) diff --git a/base/poco/Foundation/include/Poco/Platform.h b/base/poco/Foundation/include/Poco/Platform.h index 081c8474046..a0d88d096c9 100644 --- a/base/poco/Foundation/include/Poco/Platform.h +++ b/base/poco/Foundation/include/Poco/Platform.h @@ -86,9 +86,6 @@ #elif defined(sun) || defined(__sun) # define POCO_OS_FAMILY_UNIX 1 # define POCO_OS POCO_OS_SOLARIS -#elif defined(__QNX__) -# define POCO_OS_FAMILY_UNIX 1 -# define POCO_OS POCO_OS_QNX #elif defined(unix) || defined(__unix) || defined(__unix__) # define POCO_OS_FAMILY_UNIX 1 # define POCO_OS POCO_OS_UNKNOWN_UNIX diff --git a/base/poco/Foundation/include/Poco/StreamUtil.h b/base/poco/Foundation/include/Poco/StreamUtil.h index 7668ec4555d..fa1814a0f2e 100644 --- a/base/poco/Foundation/include/Poco/StreamUtil.h +++ b/base/poco/Foundation/include/Poco/StreamUtil.h @@ -73,9 +73,6 @@ #if !defined(POCO_IOS_INIT_HACK) // Microsoft Visual Studio with Dinkumware STL (but not STLport) -# if defined(__QNX__) && !defined(__GLIBCPP__) -# define POCO_IOS_INIT_HACK 1 -# endif #endif diff --git a/base/poco/Foundation/src/FPEnvironment.cpp b/base/poco/Foundation/src/FPEnvironment.cpp index 94a837f9cd6..70c8e68af5a 100644 --- a/base/poco/Foundation/src/FPEnvironment.cpp +++ b/base/poco/Foundation/src/FPEnvironment.cpp @@ -23,8 +23,6 @@ #include "FPEnvironment_DEC.cpp" #elif defined(sun) || defined(__sun) #include "FPEnvironment_SUN.cpp" -#elif defined(__QNX__) -#include "FPEnvironment_QNX.cpp" #elif defined(POCO_OS_FAMILY_UNIX) #include "FPEnvironment_C99.cpp" #elif defined(POCO_OS_FAMILY_WINDOWS) diff --git a/base/poco/Foundation/src/Process_UNIX.cpp b/base/poco/Foundation/src/Process_UNIX.cpp index 4671278e1d8..c470edee65f 100644 --- a/base/poco/Foundation/src/Process_UNIX.cpp +++ b/base/poco/Foundation/src/Process_UNIX.cpp @@ -25,11 +25,6 @@ #include -#if defined(__QNX__) -#include -#include -#include -#endif namespace Poco { @@ -90,59 +85,7 @@ void ProcessImpl::timesImpl(long& userTime, long& kernelTime) ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const ArgsImpl& args, const std::string& initialDirectory, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe, const EnvImpl& env) { -#if defined(__QNX__) - if (initialDirectory.empty()) - { - /// use QNX's spawn system call which is more efficient than fork/exec. - char** argv = new char*[args.size() + 2]; - int i = 0; - argv[i++] = const_cast(command.c_str()); - for (ArgsImpl::const_iterator it = args.begin(); it != args.end(); ++it) - argv[i++] = const_cast(it->c_str()); - argv[i] = NULL; - struct inheritance inherit; - std::memset(&inherit, 0, sizeof(inherit)); - inherit.flags = SPAWN_ALIGN_DEFAULT | SPAWN_CHECK_SCRIPT | SPAWN_SEARCH_PATH; - int fdmap[3]; - fdmap[0] = inPipe ? inPipe->readHandle() : 0; - fdmap[1] = outPipe ? outPipe->writeHandle() : 1; - fdmap[2] = errPipe ? errPipe->writeHandle() : 2; - - char** envPtr = 0; - std::vector envChars; - std::vector envPtrs; - if (!env.empty()) - { - envChars = getEnvironmentVariablesBuffer(env); - envPtrs.reserve(env.size() + 1); - char* p = &envChars[0]; - while (*p) - { - envPtrs.push_back(p); - while (*p) ++p; - ++p; - } - envPtrs.push_back(0); - envPtr = &envPtrs[0]; - } - - int pid = spawn(command.c_str(), 3, fdmap, &inherit, argv, envPtr); - delete [] argv; - if (pid == -1) - throw SystemException("cannot spawn", command); - - if (inPipe) inPipe->close(Pipe::CLOSE_READ); - if (outPipe) outPipe->close(Pipe::CLOSE_WRITE); - if (errPipe) errPipe->close(Pipe::CLOSE_WRITE); - return new ProcessHandleImpl(pid); - } - else - { - return launchByForkExecImpl(command, args, initialDirectory, inPipe, outPipe, errPipe, env); - } -#else return launchByForkExecImpl(command, args, initialDirectory, inPipe, outPipe, errPipe, env); -#endif }