From: Pino Toscano Date: Mon, 17 Jan 2022 19:43:01 +0000 (+0100) Subject: [PATCH] QProcess/Unix: fallback on _POSIX_PIPE_BUF w/ missing PIPE_BUF X-Git-Tag: archive/raspbian/6.3.1+dfsg-10+rpi1^2~7 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=017eaaa6e0eb2dd6926617c1a330355a5bfc5ca8;p=qt6-base.git [PATCH] QProcess/Unix: fallback on _POSIX_PIPE_BUF w/ missing PIPE_BUF PIPE_BUF is optional in POSIX, e.g. "where the corresponding value is equal to or greater than the stated minimum, but where the value can vary depending on the file to which it is applied." [1] GNU/Hurd does not provide PIPE_BUF, so fallback to its minimum acceptable value, that is _POSIX_PIPE_BUF. [1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html Also, explicitly include in this file, to make sure PIPE_BUF or _POSIX_PIPE_BUF are available without relying on other headers to pull . Change-Id: Ifae964db81841e1d31fc09e73b45594af9a326d1 Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira Gbp-Pq: Name upstream_QProcess-Unix-fallback-on-_POSIX_PIPE_BUF-w-missing-.patch --- diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 3a2e5cf5..9f97bb7a 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -69,6 +69,7 @@ #endif #include +#include #include #include @@ -936,7 +937,11 @@ bool QProcessPrivate::startDetached(qint64 *pid) { QByteArray encodedWorkingDirectory = QFile::encodeName(workingDirectory); +#ifdef PIPE_BUF static_assert(PIPE_BUF >= sizeof(ChildError)); +#else + static_assert(_POSIX_PIPE_BUF >= sizeof(ChildError)); +#endif ChildError childStatus = { 0, {} }; AutoPipe startedPipe, pidPipe;