Skip to content
Snippets Groups Projects

darwinvlc: remove SIGCHLD GCD handling

Merged Alexandre Janniaux requested to merge alexandre-janniaux/vlc:darwin-sigchld-29099 into master
  1. Apr 14, 2025
    • Alexandre Janniaux's avatar
      darwinvlc: remove SIGCHLD GCD handling · 120b4939
      Alexandre Janniaux authored and Rémi Denis-Courmont's avatar Rémi Denis-Courmont committed
      The handling through GCD was added back then in commit
      cc07bce0. In that commit,
      signal(SIGCHLD, SIG_DFL) was already called to ensure the behavior of
      the signal is restored to default handlers.
      
      In `man 3 signal` from the macos manual, it is said that when setting
      SIG_IGN for SIGCHLD, the operating system will not create zombie process
      and the exit status will be ignored. We do want to avoid creating zombie
      process but we also want to have exit status, which means we do indeed
      need the SIG_DFL handler here. See also the following commit on the
      linux side: 94763831.
      
      However, GCD was used to automatically call waitpid() on the process
      that are being signalled as closing. Since we're always calling waitpid
      when spawning any process, this duplicates the handling. But the clients
      are actually using vlc_waitpid which is checking errno != ECHILD, so it
      would break as soon as the GCD handler is executed before...
      120b4939
Loading