Use exit-status macros for compatibility 2/3
authorRobin Gareus <robin@gareus.org>
Thu, 4 Jul 2019 20:21:35 +0000 (22:21 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 4 Jul 2019 20:21:35 +0000 (22:21 +0200)
libs/ardour/filesystem_paths.cc
libs/fst/scanner.cc
libs/gtkmm2ext/gtk_ui.cc
libs/pbd/openuri.cc
libs/pbd/system_exec.cc
libs/pbd/transmitter.cc

index ee5fc97ad760610d064a96651703b3f2c1e70526..5ecef5863e4eb0fc7176618fcd659b71b0710475 100644 (file)
@@ -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
index 9bf714ff69ac28f8ba773ff2b1565a7194fc7256..405bf56201fc0ba2ad2298d81d9d90fc626fbb5f 100644 (file)
@@ -76,7 +76,7 @@ class DummyReceiver : public Receiver {
                        std::cerr << prefix << str << std::endl;
 
                        if (chn == Transmitter::Fatal) {
-                               ::exit (1);
+                               ::exit (EXIT_FAILURE);
                        }
                }
 };
index 444e7471e95239fff2a600721d3dd77aee14fbd2..2f5d0ac6b4ea8e1f8fd98b2ca0538c01304f53b0 100644 (file)
@@ -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();
index 1843043ea5b1294cf8c290831ca3c43a48adb3fe..7d096e715352ce717896134a0a66d56d2a9b543f 100644 (file)
@@ -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
 
index 0a17cce56079de8364f10ce3f8700a1cff41bdb2..97f105687265f469f3ad9106e86dfa50a20317a9 100644 (file)
@@ -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;
 }
 
index fccb667b4888415413ef5d8f744a557a6ce1faf1..0e9ae795307cc36b4c4ddd11854baf8ec2e59c42 100644 (file)
@@ -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