summaryrefslogtreecommitdiff
path: root/devel/electron13/files/patch-printing_backend_cups__helper.cc
diff options
context:
space:
mode:
Diffstat (limited to 'devel/electron13/files/patch-printing_backend_cups__helper.cc')
-rw-r--r--devel/electron13/files/patch-printing_backend_cups__helper.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/devel/electron13/files/patch-printing_backend_cups__helper.cc b/devel/electron13/files/patch-printing_backend_cups__helper.cc
new file mode 100644
index 000000000000..8324d6c923df
--- /dev/null
+++ b/devel/electron13/files/patch-printing_backend_cups__helper.cc
@@ -0,0 +1,38 @@
+--- printing/backend/cups_helper.cc.orig 2021-07-15 19:13:43 UTC
++++ printing/backend/cups_helper.cc
+@@ -24,7 +24,7 @@
+ #include "printing/units.h"
+ #include "url/gurl.h"
+
+-#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD)
+ #include <unistd.h>
+
+ #include "base/files/scoped_file.h"
+@@ -578,7 +578,7 @@ bool ParsePpdCapabilities(cups_dest_t* dest,
+ base::StringPiece printer_capabilities,
+ PrinterSemanticCapsAndDefaults* printer_info) {
+ base::FilePath ppd_file_path;
+-#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD)
+ // A file created while in a sandbox will be automatically deleted once all
+ // handles to it have been closed. This precludes the use of multiple
+ // operations against a file path.
+@@ -625,7 +625,7 @@ bool ParsePpdCapabilities(cups_dest_t* dest,
+ ppd_status_t ppd_status = ppdLastError(&line);
+ LOG(ERROR) << "Failed to open PDD file: error " << ppd_status << " at line "
+ << line << ", " << ppdErrorString(ppd_status);
+-#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD)
+ if (ppd_status != PPD_FILE_OPEN_ERROR) {
+ // When the error is not from opening the file then the CUPS library
+ // internals will have already closed the file descriptor. It is
+@@ -716,7 +716,7 @@ bool ParsePpdCapabilities(cups_dest_t* dest,
+ }
+
+ ppdClose(ppd);
+-#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD)
+ // The CUPS library internals close the file descriptor upon successfully
+ // reading it. Explicitly release the `ScopedFD` to prevent a crash caused
+ // by a bad file descriptor.