summarylogtreecommitdiffstats
path: root/swiftpm-glibc.patch
diff options
context:
space:
mode:
authorMichael Hansen2019-11-29 20:12:10 -0800
committerMichael Hansen2019-11-29 20:12:10 -0800
commite3afc127bef6c406ab65503a8571d1abd458d7d0 (patch)
treed5e4d7f6ca46a107eaa1dd40758d7f4f00b3eb1f /swiftpm-glibc.patch
parentebb2c7c5023766c176cd68b6ca854e0d6639be14 (diff)
downloadaur-e3afc127bef6c406ab65503a8571d1abd458d7d0.tar.gz
Update to 5.1.2
Diffstat (limited to 'swiftpm-glibc.patch')
-rw-r--r--swiftpm-glibc.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/swiftpm-glibc.patch b/swiftpm-glibc.patch
new file mode 100644
index 000000000000..f3fa8c1815af
--- /dev/null
+++ b/swiftpm-glibc.patch
@@ -0,0 +1,25 @@
+diff --git a/Sources/Basic/Process.swift b/Sources/Basic/Process.swift
+index 2e2efd448..f65702709 100644
+--- a/Sources/Basic/Process.swift
++++ b/Sources/Basic/Process.swift
+@@ -366,7 +366,10 @@ public final class Process: ObjectIdentifierProtocol {
+ defer { posix_spawn_file_actions_destroy(&fileActions) }
+
+ // Workaround for https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=89e435f3559c53084498e9baad22172b64429362
+- let devNull = strdup("/dev/null")
++ // Change allowing for newer version of glibc
++ guard let devNull = strdup("/dev/null") else {
++ throw SystemError.posix_spawn(0, arguments)
++ }
+ defer { free(devNull) }
+ // Open /dev/null as stdin.
+ posix_spawn_file_actions_addopen(&fileActions, 0, devNull, O_RDONLY, 0)
+@@ -392,7 +395,7 @@ public final class Process: ObjectIdentifierProtocol {
+
+ let argv = CStringArray(arguments)
+ let env = CStringArray(environment.map({ "\($0.0)=\($0.1)" }))
+- let rv = posix_spawnp(&processID, argv.cArray[0], &fileActions, &attributes, argv.cArray, env.cArray)
++ let rv = posix_spawnp(&processID, argv.cArray[0]!, &fileActions, &attributes, argv.cArray, env.cArray)
+
+ guard rv == 0 else {
+ throw SystemError.posix_spawn(rv, arguments)