From e76e18af961273cd7a275d5f17e2eeb836631010 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 4 Jul 2019 22:21:35 +0200 Subject: [PATCH] Use exit-status macros for compatibility 2/3 --- libs/ardour/filesystem_paths.cc | 10 +++++----- libs/fst/scanner.cc | 2 +- libs/gtkmm2ext/gtk_ui.cc | 2 +- libs/pbd/openuri.cc | 2 +- libs/pbd/system_exec.cc | 2 +- libs/pbd/transmitter.cc | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libs/ardour/filesystem_paths.cc b/libs/ardour/filesystem_paths.cc index ee5fc97ad7..5ecef5863e 100644 --- a/libs/ardour/filesystem_paths.cc +++ b/libs/ardour/filesystem_paths.cc @@ -98,7 +98,7 @@ user_config_directory (int version) #endif if (home_dir.empty ()) { error << "Unable to determine home directory" << endmsg; - exit (1); + exit (EXIT_FAILURE); } p = home_dir; @@ -119,7 +119,7 @@ user_config_directory (int version) if (g_mkdir_with_parents (p.c_str(), 0755)) { error << string_compose (_("Cannot create Configuration directory %1 - cannot run"), p) << endmsg; - exit (1); + exit (EXIT_FAILURE); } } else if (!Glib::file_test (p, Glib::FILE_TEST_IS_DIR)) { fatal << string_compose (_("Configuration directory %1 already exists and is not a directory/folder - cannot run"), @@ -156,7 +156,7 @@ user_cache_directory (std::string cachename) #endif if (home_dir.empty ()) { error << "Unable to determine home directory" << endmsg; - exit (1); + exit (EXIT_FAILURE); } p = home_dir; @@ -187,7 +187,7 @@ user_cache_directory (std::string cachename) if (g_mkdir_with_parents (p.c_str(), 0755)) { error << string_compose (_("Cannot create cache directory %1 - cannot run"), p) << endmsg; - exit (1); + exit (EXIT_FAILURE); } } else if (!Glib::file_test (p, Glib::FILE_TEST_IS_DIR)) { fatal << string_compose (_("Cache directory %1 already exists and is not a directory/folder - cannot run"), @@ -209,7 +209,7 @@ ardour_dll_directory () std::string s = Glib::getenv("ARDOUR_DLL_PATH"); if (s.empty()) { std::cerr << _("ARDOUR_DLL_PATH not set in environment - exiting\n"); - ::exit (1); + ::exit (EXIT_FAILURE); } return s; #endif diff --git a/libs/fst/scanner.cc b/libs/fst/scanner.cc index 9bf714ff69..405bf56201 100644 --- a/libs/fst/scanner.cc +++ b/libs/fst/scanner.cc @@ -76,7 +76,7 @@ class DummyReceiver : public Receiver { std::cerr << prefix << str << std::endl; if (chn == Transmitter::Fatal) { - ::exit (1); + ::exit (EXIT_FAILURE); } } }; diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc index 444e7471e9..2f5d0ac6b4 100644 --- a/libs/gtkmm2ext/gtk_ui.cc +++ b/libs/gtkmm2ext/gtk_ui.cc @@ -594,7 +594,7 @@ UI::process_error_message (Transmitter::Channel chn, const char *str) default: /* no choice but to use text/console output here */ cerr << "programmer error in UI::check_error_messages (channel = " << chn << ")\n"; - ::exit (1); + ::exit (EXIT_FAILURE); } errors->text().get_buffer()->begin_user_action(); diff --git a/libs/pbd/openuri.cc b/libs/pbd/openuri.cc index 1843043ea5..7d096e7153 100644 --- a/libs/pbd/openuri.cc +++ b/libs/pbd/openuri.cc @@ -77,7 +77,7 @@ PBD::open_uri (const char* uri) #else if (::vfork () == 0) { ::execlp ("xdg-open", "xdg-open", s.c_str(), (char*)NULL); - exit (0); + exit (EXIT_SUCCESS); } #endif diff --git a/libs/pbd/system_exec.cc b/libs/pbd/system_exec.cc index 0a17cce560..97f1056872 100644 --- a/libs/pbd/system_exec.cc +++ b/libs/pbd/system_exec.cc @@ -962,7 +962,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 (-1); + exit (EXIT_FAILURE); return -1; } diff --git a/libs/pbd/transmitter.cc b/libs/pbd/transmitter.cc index fccb667b48..0e9ae79530 100644 --- a/libs/pbd/transmitter.cc +++ b/libs/pbd/transmitter.cc @@ -91,7 +91,7 @@ Transmitter::deliver () sigemptyset (&mask); sigsuspend (&mask); /*NOTREACHED*/ - exit (1); + exit (EXIT_FAILURE); /* JE - From what I can tell, the above code suspends * program execution until (any) signal occurs. Not * sure at the moment what this achieves, unless it