xwayland: Prevent potential file descriptor leak
This commit is contained in:
parent
1e0d5bba71
commit
02fd869106
1 changed files with 2 additions and 1 deletions
|
@ -16,6 +16,7 @@
|
|||
#include "wayland/seat_interface.h"
|
||||
#include "wayland_server.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <xwayland_logging.h>
|
||||
|
@ -147,7 +148,7 @@ bool WlSource::checkStartTransfer(xcb_selection_request_event_t *event)
|
|||
}
|
||||
|
||||
int p[2];
|
||||
if (pipe(p) == -1) {
|
||||
if (pipe2(p, O_CLOEXEC) == -1) {
|
||||
qCWarning(KWIN_XWL) << "Pipe failed. Not sending selection.";
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue