13
0

Use exit-status macros for compatibility 3/3

This commit is contained in:
Robin Gareus 2019-07-04 22:21:49 +02:00
parent e76e18af96
commit 8f9a1e1cf4
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
4 changed files with 20 additions and 20 deletions

View File

@ -90,7 +90,7 @@ ActionManager::load_menus (const string& menus_file)
if (!loaded) { if (!loaded) {
cerr << string_compose (_("%1 will not work without a valid menu definition file"), PROGRAM_NAME) << endl; cerr << string_compose (_("%1 will not work without a valid menu definition file"), PROGRAM_NAME) << endl;
error << string_compose (_("%1 will not work without a valid menu definition file"), PROGRAM_NAME) << endmsg; error << string_compose (_("%1 will not work without a valid menu definition file"), PROGRAM_NAME) << endmsg;
exit(1); exit (EXIT_FAILURE);
} }
} }

View File

@ -351,7 +351,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
MessageDialog msg (string_compose (_("Your configuration files were copied. You can now restart %1."), PROGRAM_NAME), true); MessageDialog msg (string_compose (_("Your configuration files were copied. You can now restart %1."), PROGRAM_NAME), true);
msg.run (); msg.run ();
/* configuration was modified, exit immediately */ /* configuration was modified, exit immediately */
_exit (0); _exit (EXIT_SUCCESS);
} }
@ -739,7 +739,7 @@ ARDOUR_UI::post_engine ()
halt_connection.disconnect (); halt_connection.disconnect ();
AudioEngine::instance()->stop (); AudioEngine::instance()->stop ();
exit (0); exit (EXIT_SUCCESS);
} }
@ -816,7 +816,7 @@ ARDOUR_UI::post_engine ()
halt_connection.disconnect (); halt_connection.disconnect ();
AudioEngine::instance()->stop (); AudioEngine::instance()->stop ();
exit (0); exit (EXIT_SUCCESS);
} }
/* this being a GUI and all, we want peakfiles */ /* this being a GUI and all, we want peakfiles */
@ -1261,7 +1261,7 @@ ARDOUR_UI::starting ()
c.signal_toggled().connect (sigc::hide_return (sigc::bind (sigc::ptr_fun (toggle_file_existence), path))); c.signal_toggled().connect (sigc::hide_return (sigc::bind (sigc::ptr_fun (toggle_file_existence), path)));
if (d.run () != RESPONSE_OK) { if (d.run () != RESPONSE_OK) {
_exit (0); _exit (EXIT_SUCCESS);
} }
} }
#endif #endif
@ -1878,7 +1878,7 @@ ARDOUR_UI::open_recent_session ()
recent_session_dialog.hide(); recent_session_dialog.hide();
return; return;
} else { } else {
exit (1); exit (EXIT_FAILURE);
} }
} }
@ -3242,7 +3242,7 @@ ARDOUR_UI::load_from_application_api (const std::string& path)
ARDOUR_COMMAND_LINE::session_name = ""; ARDOUR_COMMAND_LINE::session_name = "";
if (get_session_parameters (true, false)) { if (get_session_parameters (true, false)) {
exit (1); exit (EXIT_FAILURE);
} }
} }
} }
@ -3483,12 +3483,12 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
if (ret == -2) { if (ret == -2) {
/* not connected to the AudioEngine, so quit to avoid an infinite loop */ /* not connected to the AudioEngine, so quit to avoid an infinite loop */
exit (1); exit (EXIT_FAILURE);
} }
if (!ARDOUR_COMMAND_LINE::immediate_save.empty()) { if (!ARDOUR_COMMAND_LINE::immediate_save.empty()) {
_session->save_state (ARDOUR_COMMAND_LINE::immediate_save, false); _session->save_state (ARDOUR_COMMAND_LINE::immediate_save, false);
exit (1); exit (EXIT_FAILURE);
} }
/* clear this to avoid endless attempts to load the /* clear this to avoid endless attempts to load the
@ -3518,7 +3518,7 @@ ARDOUR_UI::close_session()
ARDOUR_COMMAND_LINE::session_name = ""; ARDOUR_COMMAND_LINE::session_name = "";
if (get_session_parameters (true, false)) { if (get_session_parameters (true, false)) {
exit (1); exit (EXIT_FAILURE);
} }
} }
@ -3582,7 +3582,7 @@ ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name,
switch (response) { switch (response) {
case RESPONSE_CANCEL: case RESPONSE_CANCEL:
exit (1); exit (EXIT_FAILURE);
default: default:
break; break;
} }
@ -5577,7 +5577,7 @@ ARDOUR_UI::audioengine_became_silent ()
case Gtk::RESPONSE_NO: case Gtk::RESPONSE_NO:
/* save and quit */ /* save and quit */
save_state_canfail (""); save_state_canfail ("");
exit (0); exit (EXIT_SUCCESS);
break; break;
case Gtk::RESPONSE_CANCEL: case Gtk::RESPONSE_CANCEL:

View File

@ -149,7 +149,7 @@ This could be due to misconfiguration or to an error inside %2.\n\
Click OK to exit %1."), PROGRAM_NAME, AudioEngine::instance()->current_backend_name())); Click OK to exit %1."), PROGRAM_NAME, AudioEngine::instance()->current_backend_name()));
msg.run (); msg.run ();
_exit (0); _exit (EXIT_SUCCESS);
} else { } else {
@ -355,7 +355,7 @@ int main (int argc, char *argv[])
if (parse_opts (argc, argv)) { if (parse_opts (argc, argv)) {
command_line_parse_error (&argc, &argv); command_line_parse_error (&argc, &argv);
exit (1); exit (EXIT_FAILURE);
} }
cout << PROGRAM_NAME cout << PROGRAM_NAME
@ -369,7 +369,7 @@ int main (int argc, char *argv[])
<< endl; << endl;
if (just_version) { if (just_version) {
exit (0); exit (EXIT_SUCCESS);
} }
if (no_splash) { if (no_splash) {
@ -390,7 +390,7 @@ int main (int argc, char *argv[])
"Run %1 from a commandline for more information."), PROGRAM_NAME), "Run %1 from a commandline for more information."), PROGRAM_NAME),
false, Gtk::MESSAGE_ERROR , Gtk::BUTTONS_OK, true); false, Gtk::MESSAGE_ERROR , Gtk::BUTTONS_OK, true);
msg.run (); msg.run ();
exit (1); exit (EXIT_FAILURE);
} }
if (curvetest_file) { if (curvetest_file) {
@ -407,14 +407,14 @@ int main (int argc, char *argv[])
if (UIConfiguration::instance().pre_gui_init ()) { if (UIConfiguration::instance().pre_gui_init ()) {
error << _("Could not complete pre-GUI initialization") << endmsg; error << _("Could not complete pre-GUI initialization") << endmsg;
exit (1); exit (EXIT_FAILURE);
} }
try { try {
ui = new ARDOUR_UI (&argc, &argv, localedir.c_str()); ui = new ARDOUR_UI (&argc, &argv, localedir.c_str());
} catch (failed_constructor& err) { } catch (failed_constructor& err) {
error << string_compose (_("could not create %1 GUI"), PROGRAM_NAME) << endmsg; error << string_compose (_("could not create %1 GUI"), PROGRAM_NAME) << endmsg;
exit (1); exit (EXIT_FAILURE);
} }
#ifndef NDEBUG #ifndef NDEBUG

View File

@ -158,7 +158,7 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
case 'h': case 'h':
print_help (execname); print_help (execname);
exit (0); exit (EXIT_SUCCESS);
break; break;
case 'H': case 'H':
#ifndef NDEBUG #ifndef NDEBUG
@ -187,7 +187,7 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
case 'D': case 'D':
if (PBD::parse_debug_options (optarg)) { if (PBD::parse_debug_options (optarg)) {
exit (0); exit (EXIT_SUCCESS);
} }
break; break;