From cf0904f752ea506b165d64b82f69df9d8ec0a846 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 31 Oct 2020 22:33:10 +0100 Subject: [PATCH] Handle vfork/exec failure Don't call atexit, exit without cleanup. --- libs/backends/pulseaudio/pulseaudio_backend.cc | 2 +- libs/pbd/openuri.cc | 2 +- libs/pbd/system_exec.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/backends/pulseaudio/pulseaudio_backend.cc b/libs/backends/pulseaudio/pulseaudio_backend.cc index d9b9691f98..1dddc8ccff 100644 --- a/libs/backends/pulseaudio/pulseaudio_backend.cc +++ b/libs/backends/pulseaudio/pulseaudio_backend.cc @@ -562,7 +562,7 @@ PulseAudioBackend::launch_control_app () { if (::vfork () == 0) { ::execlp ("pavucontrol", "pavucontrol", (char*)NULL); - exit (EXIT_SUCCESS); + _exit (EXIT_SUCCESS); } } diff --git a/libs/pbd/openuri.cc b/libs/pbd/openuri.cc index 40febbc469..336ec79d75 100644 --- a/libs/pbd/openuri.cc +++ b/libs/pbd/openuri.cc @@ -72,7 +72,7 @@ PBD::open_uri (const char* uri) if (::vfork () == 0) { ::execlp ("xdg-open", "xdg-open", s.c_str(), (char*)NULL); - exit (EXIT_SUCCESS); + _exit (EXIT_SUCCESS); } #endif /* not PLATFORM_WINDOWS and not __APPLE__ */ diff --git a/libs/pbd/system_exec.cc b/libs/pbd/system_exec.cc index 8afe6f6c11..6e66b134c2 100644 --- a/libs/pbd/system_exec.cc +++ b/libs/pbd/system_exec.cc @@ -818,7 +818,7 @@ SystemExec::start (StdErrMode stderr_mode, const char *vfork_exec_wrapper) char buf = 0; (void) ::write (pok[1], &buf, 1); close_fd (pok[1]); - exit (EXIT_FAILURE); + _exit (EXIT_FAILURE); return -1; }