Use exit-status macros for compatibility 2/3

This commit is contained in:
Robin Gareus 2019-07-04 22:21:35 +02:00
parent dbc0c54ced
commit e76e18af96
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
6 changed files with 10 additions and 10 deletions

View file

@ -98,7 +98,7 @@ user_config_directory (int version)
#endif #endif
if (home_dir.empty ()) { if (home_dir.empty ()) {
error << "Unable to determine home directory" << endmsg; error << "Unable to determine home directory" << endmsg;
exit (1); exit (EXIT_FAILURE);
} }
p = home_dir; p = home_dir;
@ -119,7 +119,7 @@ user_config_directory (int version)
if (g_mkdir_with_parents (p.c_str(), 0755)) { if (g_mkdir_with_parents (p.c_str(), 0755)) {
error << string_compose (_("Cannot create Configuration directory %1 - cannot run"), error << string_compose (_("Cannot create Configuration directory %1 - cannot run"),
p) << endmsg; p) << endmsg;
exit (1); exit (EXIT_FAILURE);
} }
} else if (!Glib::file_test (p, Glib::FILE_TEST_IS_DIR)) { } 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"), 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 #endif
if (home_dir.empty ()) { if (home_dir.empty ()) {
error << "Unable to determine home directory" << endmsg; error << "Unable to determine home directory" << endmsg;
exit (1); exit (EXIT_FAILURE);
} }
p = home_dir; p = home_dir;
@ -187,7 +187,7 @@ user_cache_directory (std::string cachename)
if (g_mkdir_with_parents (p.c_str(), 0755)) { if (g_mkdir_with_parents (p.c_str(), 0755)) {
error << string_compose (_("Cannot create cache directory %1 - cannot run"), error << string_compose (_("Cannot create cache directory %1 - cannot run"),
p) << endmsg; p) << endmsg;
exit (1); exit (EXIT_FAILURE);
} }
} else if (!Glib::file_test (p, Glib::FILE_TEST_IS_DIR)) { } 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"), 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"); std::string s = Glib::getenv("ARDOUR_DLL_PATH");
if (s.empty()) { if (s.empty()) {
std::cerr << _("ARDOUR_DLL_PATH not set in environment - exiting\n"); std::cerr << _("ARDOUR_DLL_PATH not set in environment - exiting\n");
::exit (1); ::exit (EXIT_FAILURE);
} }
return s; return s;
#endif #endif

View file

@ -76,7 +76,7 @@ class DummyReceiver : public Receiver {
std::cerr << prefix << str << std::endl; std::cerr << prefix << str << std::endl;
if (chn == Transmitter::Fatal) { if (chn == Transmitter::Fatal) {
::exit (1); ::exit (EXIT_FAILURE);
} }
} }
}; };

View file

@ -594,7 +594,7 @@ UI::process_error_message (Transmitter::Channel chn, const char *str)
default: default:
/* no choice but to use text/console output here */ /* no choice but to use text/console output here */
cerr << "programmer error in UI::check_error_messages (channel = " << chn << ")\n"; cerr << "programmer error in UI::check_error_messages (channel = " << chn << ")\n";
::exit (1); ::exit (EXIT_FAILURE);
} }
errors->text().get_buffer()->begin_user_action(); errors->text().get_buffer()->begin_user_action();

View file

@ -77,7 +77,7 @@ PBD::open_uri (const char* uri)
#else #else
if (::vfork () == 0) { if (::vfork () == 0) {
::execlp ("xdg-open", "xdg-open", s.c_str(), (char*)NULL); ::execlp ("xdg-open", "xdg-open", s.c_str(), (char*)NULL);
exit (0); exit (EXIT_SUCCESS);
} }
#endif #endif

View file

@ -962,7 +962,7 @@ SystemExec::start (StdErrMode stderr_mode, const char *vfork_exec_wrapper)
char buf = 0; char buf = 0;
(void) ::write (pok[1], &buf, 1); (void) ::write (pok[1], &buf, 1);
close_fd (pok[1]); close_fd (pok[1]);
exit (-1); exit (EXIT_FAILURE);
return -1; return -1;
} }

View file

@ -91,7 +91,7 @@ Transmitter::deliver ()
sigemptyset (&mask); sigemptyset (&mask);
sigsuspend (&mask); sigsuspend (&mask);
/*NOTREACHED*/ /*NOTREACHED*/
exit (1); exit (EXIT_FAILURE);
/* JE - From what I can tell, the above code suspends /* JE - From what I can tell, the above code suspends
* program execution until (any) signal occurs. Not * program execution until (any) signal occurs. Not
* sure at the moment what this achieves, unless it * sure at the moment what this achieves, unless it