PipeWire capturer: fix fcntl call when duplicating a file descriptor

The fcntl() call has variable arguments, therefore we need to pass 0 to
specify there are no other arguments for this call, otherwise we might
end up with an argument that is random garbage.

Bug: webrtc:15174
Change-Id: I34f16a942d80913b667d8ade7eed557b0233be01
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305120
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Commit-Queue: Jan Grulich <grulja@gmail.com>
Cr-Commit-Position: refs/heads/main@{#40060}
This commit is contained in:
Jan Grulich 2023-05-12 20:59:06 +02:00 committed by WebRTC LUCI CQ
parent 016e57c68c
commit 7b0d7f48fb

View File

@ -452,8 +452,8 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream(
PipeWireThreadLoopLock thread_loop_lock(pw_main_loop_);
if (fd >= 0) {
pw_core_ = pw_context_connect_fd(pw_context_, fcntl(fd, F_DUPFD_CLOEXEC),
nullptr, 0);
pw_core_ = pw_context_connect_fd(
pw_context_, fcntl(fd, F_DUPFD_CLOEXEC, 0), nullptr, 0);
} else {
pw_core_ = pw_context_connect(pw_context_, nullptr, 0);
}