aboutsummaryrefslogtreecommitdiffstats
path: root/rawshark.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-04-13 01:23:21 -0700
committerGuy Harris <gharris@sonic.net>2021-04-13 01:23:21 -0700
commit9b70baac96430598b24ac9d6f14d14c80151f2e4 (patch)
tree6c8209fbe7c1ea6f950ce55bf9c746a968b1e69d /rawshark.c
parent20b662b01d5871e831030f5760bd21b6e2fc0935 (diff)
Add a new header defining commonly-used exit codes.
"Commonly-used" meaning "used by more than one source file". Clean up the exit codes, combining some duplicates with different names, and using some instead of raw numbers in some places.
Diffstat (limited to 'rawshark.c')
-rw-r--r--rawshark.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/rawshark.c b/rawshark.c
index 8252a3666f..c148874abf 100644
--- a/rawshark.c
+++ b/rawshark.c
@@ -52,6 +52,7 @@
#include <epan/epan.h>
#include <ui/cmdarg_err.h>
+#include <ui/exit_codes.h>
#include <wsutil/filesystem.h>
#include <wsutil/file_util.h>
#include <wsutil/socket.h>
@@ -111,11 +112,9 @@
static const gchar decode_as_arg_template[] = "<layer_type>==<selector>,<decode_as_protocol>";
#endif
-#define INVALID_OPTION 1
-#define INIT_ERROR 2
+/* Additional exit codes */
#define INVALID_DFILTER 2
-#define OPEN_ERROR 2
-#define FORMAT_ERROR 2
+#define FORMAT_ERROR 2
capture_file cfile;
@@ -531,7 +530,7 @@ main(int argc, char *argv[])
dissectors, and we must do it before we read the preferences, in
case any dissectors register preferences. */
if (!epan_init(NULL, NULL, TRUE)) {
- ret = INIT_ERROR;
+ ret = INIT_FAILED;
goto clean_exit;
}
@@ -757,7 +756,7 @@ main(int argc, char *argv[])
cmdarg_err("%s", err_msg);
g_free(err_msg);
cmdarg_err_cont("%s", please_report_bug());
- ret = INIT_ERROR;
+ ret = INIT_FAILED;
goto clean_exit;
}