summaryrefslogtreecommitdiff
path: root/devel/electron4/files/patch-components_download_quarantine_quarantine__linux.cc
diff options
context:
space:
mode:
authorAntoine Brodin <antoine@FreeBSD.org>2021-01-01 10:11:34 +0000
committerAntoine Brodin <antoine@FreeBSD.org>2021-01-01 10:11:34 +0000
commit26b4c8f71f91d22e081b27814782686edde0c90a (patch)
tree1c321c39372c25d8634e75b5c8e08edc676b296d /devel/electron4/files/patch-components_download_quarantine_quarantine__linux.cc
parentNew port: math/py-optuna: A hyperparameter optimization framework (diff)
Revert r559792 to unbreak INDEX and bulk -a
It seems a lot of reverse dependencies were missed With hat: portmgr
Diffstat (limited to 'devel/electron4/files/patch-components_download_quarantine_quarantine__linux.cc')
-rw-r--r--devel/electron4/files/patch-components_download_quarantine_quarantine__linux.cc49
1 files changed, 49 insertions, 0 deletions
diff --git a/devel/electron4/files/patch-components_download_quarantine_quarantine__linux.cc b/devel/electron4/files/patch-components_download_quarantine_quarantine__linux.cc
new file mode 100644
index 000000000000..ee969234e47a
--- /dev/null
+++ b/devel/electron4/files/patch-components_download_quarantine_quarantine__linux.cc
@@ -0,0 +1,49 @@
+--- components/download/quarantine/quarantine_linux.cc.orig 2019-03-15 06:37:14 UTC
++++ components/download/quarantine/quarantine_linux.cc
+@@ -2,11 +2,15 @@
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
+
++#include "build/build_config.h"
++
+ #include "components/download/quarantine/quarantine.h"
+
+ #include <stddef.h>
+ #include <sys/types.h>
++#if !defined(OS_BSD)
+ #include <sys/xattr.h>
++#endif
+
+ #include "base/files/file_path.h"
+ #include "base/files/file_util.h"
+@@ -29,17 +33,20 @@ bool SetExtendedFileAttribute(const char* path,
+ size_t value_size,
+ int flags) {
+ base::AssertBlockingAllowed();
++#if !defined(OS_BSD)
+ int result = setxattr(path, name, value, value_size, flags);
+ if (result) {
+ DPLOG(ERROR) << "Could not set extended attribute " << name << " on file "
+ << path;
+ return false;
+ }
++#endif
+ return true;
+ }
+
+ std::string GetExtendedFileAttribute(const char* path, const char* name) {
+ base::AssertBlockingAllowed();
++#if !defined(OS_BSD)
+ ssize_t len = getxattr(path, name, nullptr, 0);
+ if (len <= 0)
+ return std::string();
+@@ -49,6 +56,9 @@ std::string GetExtendedFileAttribute(const char* path,
+ if (len < static_cast<ssize_t>(buffer.size()))
+ return std::string();
+ return std::string(buffer.begin(), buffer.end());
++#else
++ return std::string();
++#endif
+ }
+
+ } // namespace