[gnome-terminal] server: Use specific exit codes for specific error



commit 4f746f763142f222f03ff575c336b4196e2a5ad4
Author: Christian Persch <chpe gnome org>
Date:   Sun Jun 22 14:38:40 2014 +0200

    server: Use specific exit codes for specific error
    
    This will make it easier to identify which error occurred when all the client gets
    is the exit code in the error message:
    
    Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling 
StartServiceByName for org.gnome.Terminal: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process 
org.gnome.Terminal exited with status 1

 src/server.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/server.c b/src/server.c
index fc66249..fd33c36 100644
--- a/src/server.c
+++ b/src/server.c
@@ -64,6 +64,11 @@ static const GOptionEntry options[] = {
   { NULL }
 };
 
+enum {
+  _EXIT_FAILURE_WRONG_ID = 7,
+  _EXIT_FAILURE_NO_UTF8 = 8,
+};
+
 int
 main (int argc, char **argv)
 {
@@ -77,7 +82,7 @@ main (int argc, char **argv)
                   geteuid () == 0 &&
                   getegid () == 0)) {
     g_printerr ("Wrong euid/egid, exiting.\n");
-    return EXIT_FAILURE;
+    return _EXIT_FAILURE_WRONG_ID;
   }
 
   setlocale (LC_ALL, "");
@@ -86,7 +91,7 @@ main (int argc, char **argv)
 
   if (!g_get_charset (NULL)) {
     g_printerr ("Non UTF-8 locale is not supported!\n");
-    return EXIT_FAILURE;
+    return _EXIT_FAILURE_NO_UTF8;
   }
 
 #ifndef ENABLE_DISTRO_PACKAGING


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]