Skip to content
  • Ben Gamari's avatar
    cbits/fork-exec: Don't dup2 identical fds · f5e10c4a
    Ben Gamari authored
    Darwin violates POSIX by making
    `dup2(x,x)`, which should be a no-op, error. Consequently, we must take
    care not to `dup2` in such cases.
    
    We had already made this change in the `posix_spawnp` codepath but I had
    assumed that this *only* affected `posix_spawnp`, not the `dup2` system
    call itself.
    f5e10c4a