QProcess: make UnixProcessFlag an enum class
See: https://lists.qt-project.org/pipermail/development/2023-May/043804.html Not being an enum class looks more of an oversight, in most places usage of the enumerators was already prefixed with QProcess::UnixProcessFlag. Change-Id: Ie37d74e0039d3f65f90af560cb85bb11b77ae20c Pick-to: 6.6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
cdc608359a
commit
22c540a66d
@ -176,7 +176,7 @@ public:
|
|||||||
void setChildProcessModifier(const std::function<void(void)> &modifier);
|
void setChildProcessModifier(const std::function<void(void)> &modifier);
|
||||||
Q_NORETURN void failChildProcessModifier(const char *description, int error = 0) noexcept;
|
Q_NORETURN void failChildProcessModifier(const char *description, int error = 0) noexcept;
|
||||||
|
|
||||||
enum UnixProcessFlag : quint32 {
|
enum class UnixProcessFlag : quint32 {
|
||||||
ResetSignalHandlers = 0x0001, // like POSIX_SPAWN_SETSIGDEF
|
ResetSignalHandlers = 0x0001, // like POSIX_SPAWN_SETSIGDEF
|
||||||
IgnoreSigPipe = 0x0002,
|
IgnoreSigPipe = 0x0002,
|
||||||
// some room if we want to add IgnoreSigHup or so
|
// some room if we want to add IgnoreSigHup or so
|
||||||
|
@ -860,8 +860,9 @@ void QChildProcess::startProcess() const noexcept
|
|||||||
applyProcessParameters(d->unixExtras->processParameters);
|
applyProcessParameters(d->unixExtras->processParameters);
|
||||||
|
|
||||||
auto flags = d->unixExtras->processParameters.flags;
|
auto flags = d->unixExtras->processParameters.flags;
|
||||||
sigpipeHandled = flags.testAnyFlags(QProcess::ResetSignalHandlers | QProcess::IgnoreSigPipe);
|
using P = QProcess::UnixProcessFlag;
|
||||||
sigmaskHandled = flags.testFlag(QProcess::ResetSignalHandlers);
|
sigpipeHandled = flags.testAnyFlags(P::ResetSignalHandlers | P::IgnoreSigPipe);
|
||||||
|
sigmaskHandled = flags.testFlag(P::ResetSignalHandlers);
|
||||||
}
|
}
|
||||||
if (!sigpipeHandled) {
|
if (!sigpipeHandled) {
|
||||||
// reset the signal that we ignored
|
// reset the signal that we ignored
|
||||||
|
Loading…
Reference in New Issue
Block a user