Commit 16c4269
authored
Do not chdir before calling posix_spawn (#4606)
We allow users to set the working directory of the child process when they use the Process API. Unfortunately, this was implemented by calling chdir in the parent process, which has nasty global effects on the process and cannot safely be used concurrently.
glibc has a non-POSIX extension to posix_spawn that can call chdir in the child process, so we add that call instead where it's available, and add a regression test.
Resolves swiftlang/swift#59610.1 parent 5fff57e commit 16c4269
File tree
4 files changed
+72
-0
lines changed- CoreFoundation/Base.subproj
- Sources/Foundation
- Tests/Foundation/Tests
4 files changed
+72
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2210 | 2210 | | |
2211 | 2211 | | |
2212 | 2212 | | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
2213 | 2217 | | |
2214 | 2218 | | |
2215 | 2219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
709 | 709 | | |
710 | 710 | | |
711 | 711 | | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
712 | 716 | | |
713 | 717 | | |
714 | 718 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
944 | 944 | | |
945 | 945 | | |
946 | 946 | | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
947 | 958 | | |
948 | 959 | | |
949 | 960 | | |
| |||
954 | 965 | | |
955 | 966 | | |
956 | 967 | | |
| 968 | + | |
957 | 969 | | |
958 | 970 | | |
959 | 971 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
699 | 701 | | |
700 | 702 | | |
701 | 703 | | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
702 | 753 | | |
703 | 754 | | |
704 | 755 | | |
| |||
866 | 917 | | |
867 | 918 | | |
868 | 919 | | |
| 920 | + | |
869 | 921 | | |
870 | 922 | | |
871 | 923 | | |
| |||
0 commit comments