diff --git a/src/effects/screenshot/screenshotdbusinterface2.cpp b/src/effects/screenshot/screenshotdbusinterface2.cpp index 0a34c1a209..95ff37b27f 100644 --- a/src/effects/screenshot/screenshotdbusinterface2.cpp +++ b/src/effects/screenshot/screenshotdbusinterface2.cpp @@ -367,7 +367,7 @@ QVariantMap ScreenShotDBusInterface2::CaptureActiveWindow(const QVariantMap &opt return QVariantMap(); } - const int fileDescriptor = dup(pipe.fileDescriptor()); + const int fileDescriptor = fcntl(pipe.fileDescriptor(), F_DUPFD_CLOEXEC, 0); if (fileDescriptor == -1) { sendErrorReply(s_errorFileDescriptor, s_errorFileDescriptorMessage); return QVariantMap(); @@ -403,7 +403,7 @@ QVariantMap ScreenShotDBusInterface2::CaptureWindow(const QString &handle, return QVariantMap(); } - const int fileDescriptor = dup(pipe.fileDescriptor()); + const int fileDescriptor = fcntl(pipe.fileDescriptor(), F_DUPFD_CLOEXEC, 0); if (fileDescriptor == -1) { sendErrorReply(s_errorFileDescriptor, s_errorFileDescriptorMessage); return QVariantMap(); @@ -430,7 +430,7 @@ QVariantMap ScreenShotDBusInterface2::CaptureArea(int x, int y, int width, int h return QVariantMap(); } - const int fileDescriptor = dup(pipe.fileDescriptor()); + const int fileDescriptor = fcntl(pipe.fileDescriptor(), F_DUPFD_CLOEXEC, 0); if (fileDescriptor == -1) { sendErrorReply(s_errorFileDescriptor, s_errorFileDescriptorMessage); return QVariantMap(); @@ -457,7 +457,7 @@ QVariantMap ScreenShotDBusInterface2::CaptureScreen(const QString &name, return QVariantMap(); } - const int fileDescriptor = dup(pipe.fileDescriptor()); + const int fileDescriptor = fcntl(pipe.fileDescriptor(), F_DUPFD_CLOEXEC, 0); if (fileDescriptor == -1) { sendErrorReply(s_errorFileDescriptor, s_errorFileDescriptorMessage); return QVariantMap(); @@ -483,7 +483,7 @@ QVariantMap ScreenShotDBusInterface2::CaptureActiveScreen(const QVariantMap &opt return QVariantMap(); } - const int fileDescriptor = dup(pipe.fileDescriptor()); + const int fileDescriptor = fcntl(pipe.fileDescriptor(), F_DUPFD_CLOEXEC, 0); if (fileDescriptor == -1) { sendErrorReply(s_errorFileDescriptor, s_errorFileDescriptorMessage); return QVariantMap(); @@ -500,7 +500,7 @@ QVariantMap ScreenShotDBusInterface2::CaptureInteractive(uint kind, const QVariantMap &options, QDBusUnixFileDescriptor pipe) { - const int fileDescriptor = dup(pipe.fileDescriptor()); + const int fileDescriptor = fcntl(pipe.fileDescriptor(), F_DUPFD_CLOEXEC, 0); if (fileDescriptor == -1) { sendErrorReply(s_errorFileDescriptor, s_errorFileDescriptorMessage); return QVariantMap(); @@ -555,7 +555,7 @@ QVariantMap ScreenShotDBusInterface2::CaptureWorkspace(const QVariantMap &option return QVariantMap(); } - const int fileDescriptor = dup(pipe.fileDescriptor()); + const int fileDescriptor = fcntl(pipe.fileDescriptor(), F_DUPFD_CLOEXEC, 0); if (fileDescriptor == -1) { sendErrorReply(s_errorFileDescriptor, s_errorFileDescriptorMessage); return QVariantMap();