[gcalctool/vala] Use Posix defines for return codes
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcalctool/vala] Use Posix defines for return codes
- Date: Sat, 13 Oct 2012 08:10:19 +0000 (UTC)
commit baca048040549c5e5fb1ddb50538252e47c399fa
Author: Robert Ancell <robert ancell canonical com>
Date: Sat Oct 13 21:10:13 2012 +1300
Use Posix defines for return codes
src/gcalctool.vala | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/gcalctool.vala b/src/gcalctool.vala
index 65f66f5..3f5924a 100644
--- a/src/gcalctool.vala
+++ b/src/gcalctool.vala
@@ -147,12 +147,12 @@ public class GCalctool : Gtk.Application
else if (error == ErrorCode.MP)
{
stderr.printf ("Error: %s\n", mp_get_error ());
- Posix.exit (1);
+ Posix.exit (Posix.EXIT_FAILURE);
}
else
{
stderr.printf ("Error: %s\n", mp_error_code_to_string (error));
- Posix.exit (1);
+ Posix.exit (Posix.EXIT_FAILURE);
}
}
@@ -194,22 +194,22 @@ public class GCalctool : Gtk.Application
{
/* NOTE: Is not translated so can be easily parsed */
stderr.printf ("%1$s %2$s\n", progname, VERSION);
- Posix.exit (0);
+ Posix.exit (Posix.EXIT_SUCCESS);
}
else if (arg == "-h" || arg == "-?" || arg == "--help")
{
usage (progname, true, false);
- Posix.exit (0);
+ Posix.exit (Posix.EXIT_SUCCESS);
}
else if (arg == "--help-all")
{
usage (progname, true, true);
- Posix.exit (0);
+ Posix.exit (Posix.EXIT_SUCCESS);
}
else if (arg == "--help-gtk")
{
usage (progname, false, true);
- Posix.exit (0);
+ Posix.exit (Posix.EXIT_SUCCESS);
}
else if (arg == "-s" || arg == "--solve")
{
@@ -219,7 +219,7 @@ public class GCalctool : Gtk.Application
stderr.printf (/* Error printed to stderr when user uses --solve argument without an equation */
_("Argument --solve requires an equation to solve"));
stderr.printf ("\n");
- Posix.exit (1);
+ Posix.exit (Posix.EXIT_FAILURE);
}
else
solve (args[i]);
@@ -230,7 +230,7 @@ public class GCalctool : Gtk.Application
_("Unknown argument '%s'"), arg);
stderr.printf ("\n");
usage (progname, true, false);
- Posix.exit (1);
+ Posix.exit (Posix.EXIT_FAILURE);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]