Skip to content

Commit

Permalink
www/*chromium: unbreak build on 12.4; no MFD_CLOEXEC support
Browse files Browse the repository at this point in the history
PR:	273310
  • Loading branch information
rnagy committed Aug 24, 2023
1 parent 808d491 commit ffba5c0
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--- ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v1.cc.orig 2023-08-24 14:51:50 UTC
+++ ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v1.cc
@@ -224,6 +224,10 @@ void ZWPTextInputWrapperV1::SetSurroundingText(
// so if it exceeds 16 bits, it may be broken.
static constexpr size_t kSizeLimit = 60000;
if (HasAdvancedSurroundingTextSupport() && text.length() > kSizeLimit) {
+#if defined(__FreeBSD_version) && __FreeBSD_version < 1300048
+ PLOG(ERROR) << "memfd is not supported";
+ return;
+#else
base::ScopedFD memfd(memfd_create("surrounding_text", MFD_CLOEXEC));
if (!memfd.get()) {
PLOG(ERROR) << "Failed to create memfd";
@@ -236,6 +240,7 @@ void ZWPTextInputWrapperV1::SetSurroundingText(
zcr_extended_text_input_v1_set_large_surrounding_text(
extended_obj_.get(), memfd.get(), text.length(),
selection_range.start(), selection_range.end());
+#endif
} else {
zwp_text_input_v1_set_surrounding_text(obj_.get(), text.c_str(),
selection_range.start(),

0 comments on commit ffba5c0

Please sign in to comment.