diff options
Diffstat (limited to 'src/rspamadm')
-rw-r--r-- | src/rspamadm/configdump.c | 2 | ||||
-rw-r--r-- | src/rspamadm/confighelp.c | 2 | ||||
-rw-r--r-- | src/rspamadm/configtest.c | 2 | ||||
-rw-r--r-- | src/rspamadm/control.c | 8 | ||||
-rw-r--r-- | src/rspamadm/dkim_keygen.c | 2 | ||||
-rw-r--r-- | src/rspamadm/fuzzy_convert.c | 8 | ||||
-rw-r--r-- | src/rspamadm/lua_repl.c | 2 | ||||
-rw-r--r-- | src/rspamadm/pw.c | 2 | ||||
-rw-r--r-- | src/rspamadm/rspamadm.c | 2 | ||||
-rw-r--r-- | src/rspamadm/signtool.c | 58 | ||||
-rw-r--r-- | src/rspamadm/stat_convert.c | 2 |
11 files changed, 45 insertions, 45 deletions
diff --git a/src/rspamadm/configdump.c b/src/rspamadm/configdump.c index bbdb58c17..36ea7eca7 100644 --- a/src/rspamadm/configdump.c +++ b/src/rspamadm/configdump.c @@ -256,7 +256,7 @@ rspamadm_configdump (gint argc, gchar **argv, const struct rspamadm_command *cmd fprintf (stderr, "option parsing failed: %s\n", error->message); g_error_free (error); g_option_context_free (context); - exit (1); + exit (EXIT_FAILURE); } g_option_context_free (context); diff --git a/src/rspamadm/confighelp.c b/src/rspamadm/confighelp.c index c40891216..77a60be7a 100644 --- a/src/rspamadm/confighelp.c +++ b/src/rspamadm/confighelp.c @@ -218,7 +218,7 @@ rspamadm_confighelp (gint argc, gchar **argv, const struct rspamadm_command *cmd rspamd_fprintf (stderr, "option parsing failed: %s\n", error->message); g_error_free (error); g_option_context_free (context); - exit (1); + exit (EXIT_FAILURE); } g_option_context_free (context); diff --git a/src/rspamadm/configtest.c b/src/rspamadm/configtest.c index c11458e42..8e6b335a9 100644 --- a/src/rspamadm/configtest.c +++ b/src/rspamadm/configtest.c @@ -103,7 +103,7 @@ rspamadm_configtest (gint argc, gchar **argv, const struct rspamadm_command *cmd fprintf (stderr, "option parsing failed: %s\n", error->message); g_error_free (error); g_option_context_free (context); - exit (1); + exit (EXIT_FAILURE); } g_option_context_free (context); diff --git a/src/rspamadm/control.c b/src/rspamadm/control.c index 7bf2a3145..4a660492e 100644 --- a/src/rspamadm/control.c +++ b/src/rspamadm/control.c @@ -186,14 +186,14 @@ rspamadm_control (gint argc, gchar **argv, const struct rspamadm_command *_cmd) rspamd_fprintf (stderr, "option parsing failed: %s\n", error->message); g_error_free (error); g_option_context_free (context); - exit (1); + exit (EXIT_FAILURE); } g_option_context_free (context); if (argc <= 1) { rspamd_fprintf (stderr, "command required\n"); - exit (1); + exit (EXIT_FAILURE); } cmd = argv[1]; @@ -220,13 +220,13 @@ rspamadm_control (gint argc, gchar **argv, const struct rspamadm_command *_cmd) } else { rspamd_fprintf (stderr, "unknown command: %s\n", cmd); - exit (1); + exit (EXIT_FAILURE); } if (!rspamd_parse_inet_address (&addr, control_path, strlen (control_path), RSPAMD_INET_ADDRESS_PARSE_DEFAULT)) { rspamd_fprintf (stderr, "bad control path: %s\n", control_path); - exit (1); + exit (EXIT_FAILURE); } diff --git a/src/rspamadm/dkim_keygen.c b/src/rspamadm/dkim_keygen.c index 64e71f36e..a1e7286ae 100644 --- a/src/rspamadm/dkim_keygen.c +++ b/src/rspamadm/dkim_keygen.c @@ -357,7 +357,7 @@ rspamadm_dkim_keygen (gint argc, gchar **argv, const struct rspamadm_command *cm fprintf (stderr, "option parsing failed: %s\n", error->message); g_error_free (error); g_option_context_free (context); - exit (1); + exit (EXIT_FAILURE); } g_option_context_free (context); diff --git a/src/rspamadm/fuzzy_convert.c b/src/rspamadm/fuzzy_convert.c index 11386de65..b8d0c8d69 100644 --- a/src/rspamadm/fuzzy_convert.c +++ b/src/rspamadm/fuzzy_convert.c @@ -94,22 +94,22 @@ rspamadm_fuzzyconvert (gint argc, gchar **argv, const struct rspamadm_command *c rspamd_fprintf (stderr, "option parsing failed: %s\n", error->message); g_error_free (error); g_option_context_free (context); - exit (1); + exit (EXIT_FAILURE); } g_option_context_free (context); if (!source_db) { rspamd_fprintf (stderr, "source db is missing\n"); - exit (1); + exit (EXIT_FAILURE); } if (!redis_host) { rspamd_fprintf (stderr, "redis host is missing\n"); - exit (1); + exit (EXIT_FAILURE); } if (!fuzzy_expiry) { rspamd_fprintf (stderr, "expiry is missing\n"); - exit (1); + exit (EXIT_FAILURE); } obj = ucl_object_typed_new (UCL_OBJECT); diff --git a/src/rspamadm/lua_repl.c b/src/rspamadm/lua_repl.c index 945b5635c..3497a85b8 100644 --- a/src/rspamadm/lua_repl.c +++ b/src/rspamadm/lua_repl.c @@ -868,7 +868,7 @@ rspamadm_lua (gint argc, gchar **argv, const struct rspamadm_command *cmd) fprintf (stderr, "option parsing failed: %s\n", error->message); g_error_free (error); g_option_context_free (context); - exit (1); + exit (EXIT_FAILURE); } g_option_context_free (context); diff --git a/src/rspamadm/pw.c b/src/rspamadm/pw.c index c8e59cbc4..c81c96a94 100644 --- a/src/rspamadm/pw.c +++ b/src/rspamadm/pw.c @@ -373,7 +373,7 @@ rspamadm_pw (gint argc, gchar **argv, const struct rspamadm_command *cmd) fprintf (stderr, "option parsing failed: %s\n", error->message); g_error_free (error); g_option_context_free (context); - exit (1); + exit (EXIT_FAILURE); } g_option_context_free (context); diff --git a/src/rspamadm/rspamadm.c b/src/rspamadm/rspamadm.c index ae766aae6..0eef24404 100644 --- a/src/rspamadm/rspamadm.c +++ b/src/rspamadm/rspamadm.c @@ -435,7 +435,7 @@ main (gint argc, gchar **argv, gchar **env) fprintf (stderr, "option parsing failed: %s\n", error->message); g_error_free (error); g_option_context_free (context); - exit (1); + exit (EXIT_FAILURE); } diff --git a/src/rspamadm/signtool.c b/src/rspamadm/signtool.c index 555937966..b236952e7 100644 --- a/src/rspamadm/signtool.c +++ b/src/rspamadm/signtool.c @@ -143,7 +143,7 @@ rspamadm_edit_file (const gchar *fname) if (fd_out == -1) { rspamd_fprintf (stderr, "cannot open %s: %s\n", fname, strerror (errno)); - exit (errno); + exit (EXIT_FAILURE); } close (fd_out); @@ -154,7 +154,7 @@ rspamadm_edit_file (const gchar *fname) if (map == NULL) { rspamd_fprintf (stderr, "cannot open %s: %s\n", fname, strerror (errno)); - exit (errno); + exit (EXIT_FAILURE); } } @@ -167,7 +167,7 @@ rspamadm_edit_file (const gchar *fname) if (fd_out == -1) { rspamd_fprintf (stderr, "cannot open tempfile %s: %s\n", tmppath, strerror (errno)); - exit (errno); + exit (EXIT_FAILURE); } if (len > 0 && write (fd_out, map, len) == -1) { @@ -176,7 +176,7 @@ rspamadm_edit_file (const gchar *fname) unlink (tmppath); munmap (map, len); close (fd_out); - exit (errno); + exit (EXIT_FAILURE); } if (len > 0) { @@ -193,7 +193,7 @@ rspamadm_edit_file (const gchar *fname) rspamd_fprintf (stderr, "cannot exec %s: %e\n", editor, err); unlink (tmppath); - exit (errno); + exit (EXIT_FAILURE); } if (!g_spawn_async (NULL, child_argv, NULL, @@ -202,7 +202,7 @@ rspamadm_edit_file (const gchar *fname) rspamd_fprintf (stderr, "cannot exec %s: %e\n", editor, err); unlink (tmppath); - exit (errno); + exit (EXIT_FAILURE); } g_strfreev (child_argv); @@ -216,7 +216,7 @@ rspamadm_edit_file (const gchar *fname) rspamd_fprintf (stderr, "failed to wait for %s: %s\n", editor, strerror (errno)); unlink (tmppath); - exit (errno); + exit (EXIT_FAILURE); } } @@ -225,7 +225,7 @@ rspamadm_edit_file (const gchar *fname) unlink (tmppath); rspamd_fprintf (stderr, "%s returned error code: %d - %e\n", editor, retcode, err); - exit (retcode); + exit (EXIT_FAILURE); } #else if (retcode != 0) { @@ -242,7 +242,7 @@ rspamadm_edit_file (const gchar *fname) rspamd_fprintf (stderr, "cannot map %s: %s\n", tmppath, strerror (errno)); unlink (tmppath); - exit (errno); + exit (EXIT_FAILURE); } rspamd_snprintf (run_cmdline, sizeof (run_cmdline), "%s.new", fname); @@ -254,7 +254,7 @@ rspamadm_edit_file (const gchar *fname) strerror (errno)); unlink (tmppath); munmap (map, len); - exit (errno); + exit (EXIT_FAILURE); } if (write (fd_out, map, len) == -1) { @@ -264,7 +264,7 @@ rspamadm_edit_file (const gchar *fname) unlink (run_cmdline); close (fd_out); munmap (map, len); - exit (errno); + exit (EXIT_FAILURE); } unlink (tmppath); @@ -299,7 +299,7 @@ rspamadm_sign_file (const gchar *fname, struct rspamd_cryptobox_keypair *kp) if (fd_input == -1) { rspamd_fprintf (stderr, "cannot open %s: %s\n", fname, strerror (errno)); - exit (errno); + exit (EXIT_FAILURE); } g_assert (fstat (fd_input, &st) != -1); @@ -311,7 +311,7 @@ rspamadm_sign_file (const gchar *fname, struct rspamd_cryptobox_keypair *kp) close (fd_input); rspamd_fprintf (stderr, "cannot open %s: %s\n", sigpath, strerror (errno)); - exit (errno); + exit (EXIT_FAILURE); } map = mmap (NULL, st.st_size, PROT_READ, MAP_SHARED, fd_input, 0); @@ -321,7 +321,7 @@ rspamadm_sign_file (const gchar *fname, struct rspamd_cryptobox_keypair *kp) close (fd_sig); rspamd_fprintf (stderr, "cannot map %s: %s\n", fname, strerror (errno)); - exit (errno); + exit (EXIT_FAILURE); } g_assert (rspamd_cryptobox_MAX_SIGBYTES >= @@ -337,7 +337,7 @@ rspamadm_sign_file (const gchar *fname, struct rspamd_cryptobox_keypair *kp) if (rename (sigpath, fname) == -1) { rspamd_fprintf (stderr, "cannot rename %s to %s: %s\n", sigpath, fname, strerror (errno)); - exit (errno); + exit (EXIT_FAILURE); } unlink (sigpath); @@ -348,7 +348,7 @@ rspamadm_sign_file (const gchar *fname, struct rspamd_cryptobox_keypair *kp) if (write (fd_sig, sig, rspamd_cryptobox_signature_bytes (mode)) == -1) { rspamd_fprintf (stderr, "cannot write signature to %s: %s\n", sigpath, strerror (errno)); - exit (errno); + exit (EXIT_FAILURE); } close (fd_sig); @@ -408,7 +408,7 @@ rspamadm_verify_file (const gchar *fname, const guchar *pk) if (fd_input == -1) { rspamd_fprintf (stderr, "cannot open %s: %s\n", fname, strerror (errno)); - exit (errno); + exit (EXIT_FAILURE); } g_assert (fstat (fd_input, &st) != -1); @@ -420,7 +420,7 @@ rspamadm_verify_file (const gchar *fname, const guchar *pk) close (fd_input); rspamd_fprintf (stderr, "cannot open %s: %s\n", sigpath, strerror (errno)); - exit (errno); + exit (EXIT_FAILURE); } map = mmap (NULL, st.st_size, PROT_READ, MAP_SHARED, fd_input, 0); @@ -430,7 +430,7 @@ rspamadm_verify_file (const gchar *fname, const guchar *pk) close (fd_sig); rspamd_fprintf (stderr, "cannot open %s: %s\n", sigpath, strerror (errno)); - exit (errno); + exit (EXIT_FAILURE); } g_assert (fstat (fd_sig, &st_sig) != -1); @@ -440,7 +440,7 @@ rspamadm_verify_file (const gchar *fname, const guchar *pk) rspamd_fprintf (stderr, "invalid signature size %s: %ud\n", fname, (guint)st_sig.st_size); munmap (map, st.st_size); - exit (errno); + exit (EXIT_FAILURE); } map_sig = mmap (NULL, st_sig.st_size, PROT_READ, MAP_SHARED, fd_sig, 0); @@ -450,7 +450,7 @@ rspamadm_verify_file (const gchar *fname, const guchar *pk) munmap (map, st.st_size); rspamd_fprintf (stderr, "cannot map %s: %s\n", sigpath, strerror (errno)); - exit (errno); + exit (EXIT_FAILURE); } ret = rspamd_cryptobox_verify (map_sig, st_sig.st_size, @@ -496,7 +496,7 @@ rspamadm_signtool (gint argc, gchar **argv, const struct rspamadm_command *cmd) rspamd_fprintf (stderr, "option parsing failed: %s\n", error->message); g_error_free (error); g_option_context_free (context); - exit (1); + exit (EXIT_FAILURE); } g_option_context_free (context); @@ -507,11 +507,11 @@ rspamadm_signtool (gint argc, gchar **argv, const struct rspamadm_command *cmd) if (verify && (!pubkey && !pubkey_file)) { rspamd_fprintf (stderr, "no pubkey for verification\n"); - exit (1); + exit (EXIT_FAILURE); } else if (!verify && (!keypair_file)) { rspamd_fprintf (stderr, "no keypair for signing\n"); - exit (1); + exit (EXIT_FAILURE); } if (verify) { @@ -527,7 +527,7 @@ rspamadm_signtool (gint argc, gchar **argv, const struct rspamadm_command *cmd) if (fd == -1) { rspamd_fprintf (stderr, "cannot open %s: %s\n", pubkey_file, strerror (errno)); - exit (errno); + exit (EXIT_FAILURE); } g_assert (fstat (fd, &st) != -1); @@ -539,7 +539,7 @@ rspamadm_signtool (gint argc, gchar **argv, const struct rspamadm_command *cmd) if (map == MAP_FAILED) { rspamd_fprintf (stderr, "cannot read %s: %s\n", pubkey_file, strerror (errno)); - exit (errno); + exit (EXIT_FAILURE); } /* XXX: assume base32 pubkey now */ @@ -555,7 +555,7 @@ rspamadm_signtool (gint argc, gchar **argv, const struct rspamadm_command *cmd) pubkey_file, (guint)flen, rspamd_cryptobox_pk_sig_bytes (mode)); - exit (errno); + exit (EXIT_FAILURE); } munmap (map, fsize); @@ -569,7 +569,7 @@ rspamadm_signtool (gint argc, gchar **argv, const struct rspamadm_command *cmd) pubkey_file, (guint)strlen (pubkey), rspamd_cryptobox_pk_sig_bytes (mode)); - exit (errno); + exit (EXIT_FAILURE); } } @@ -591,7 +591,7 @@ rspamadm_signtool (gint argc, gchar **argv, const struct rspamadm_command *cmd) (top = ucl_parser_get_object (parser)) == NULL) { rspamd_fprintf (stderr, "cannot load keypair: %s\n", ucl_parser_get_error (parser)); - exit (EINVAL); + exit (EXIT_FAILURE); } ucl_parser_free (parser); diff --git a/src/rspamadm/stat_convert.c b/src/rspamadm/stat_convert.c index cea366f76..38ce30a4d 100644 --- a/src/rspamadm/stat_convert.c +++ b/src/rspamadm/stat_convert.c @@ -129,7 +129,7 @@ rspamadm_statconvert (gint argc, gchar **argv, const struct rspamadm_command *cm rspamd_fprintf (stderr, "option parsing failed: %s\n", error->message); g_error_free (error); g_option_context_free (context); - exit (1); + exit (EXIT_FAILURE); } g_option_context_free (context); |