Commit 2f1912c
authored
Switch to posix_spawnp for macOS background launch to enable PATH lookup (AcademySoftwareFoundation#4834)
Switch to posix_spawnp for macOS background launch to enable PATH
lookup, this is a fix for:
AcademySoftwareFoundation#4640
Description:
Previously, the code used posix_spawn with argv[0] as the executable
name. This failed when argv[0] was not an absolute or relative path
(e.g., just "iv"), because posix_spawn does not perform PATH lookups.
Switched to posix_spawnp, which behaves like execvp and searches PATH
when argv[0] does not contain a '/' character. This allows the program
to re-spawn in the background using the original command name, without
requiring _NSGetExecutablePath() to resolve the full path.
Signed-off-by: Mikael Sundell <mikael.sundell@gmail.com>1 parent 09e88ab commit 2f1912c
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
| 528 | + | |
| 529 | + | |
528 | 530 | | |
529 | 531 | | |
530 | 532 | | |
| |||
547 | 549 | | |
548 | 550 | | |
549 | 551 | | |
550 | | - | |
| 552 | + | |
551 | 553 | | |
552 | 554 | | |
553 | 555 | | |
| |||
564 | 566 | | |
565 | 567 | | |
566 | 568 | | |
| 569 | + | |
567 | 570 | | |
568 | 571 | | |
569 | 572 | | |
| |||
0 commit comments