summaryrefslogtreecommitdiff
path: root/src/exchange-tools
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-07-29 23:56:46 +0200
committerChristian Grothoff <christian@grothoff.org>2021-07-29 23:56:46 +0200
commit0ef7c0a0b716785e7d1b0233e622d2e7267a0280 (patch)
treeff4b46d1182acd71fa5c6e29b9aaa786dbcf2b22 /src/exchange-tools
parent1b419adab48fc0fd915835e0d57c5923e515280c (diff)
downloadexchange-0ef7c0a0b716785e7d1b0233e622d2e7267a0280.tar.gz
exchange-0ef7c0a0b716785e7d1b0233e622d2e7267a0280.tar.bz2
exchange-0ef7c0a0b716785e7d1b0233e622d2e7267a0280.zip
fix #6960
Diffstat (limited to 'src/exchange-tools')
-rw-r--r--src/exchange-tools/taler-auditor-offline.c66
-rw-r--r--src/exchange-tools/taler-exchange-dbinit.c11
-rw-r--r--src/exchange-tools/taler-exchange-offline.c132
3 files changed, 105 insertions, 104 deletions
diff --git a/src/exchange-tools/taler-auditor-offline.c b/src/exchange-tools/taler-auditor-offline.c
index 33743bb3a..cc7278e54 100644
--- a/src/exchange-tools/taler-auditor-offline.c
+++ b/src/exchange-tools/taler-auditor-offline.c
@@ -407,7 +407,7 @@ denomination_add_cb (
NULL != hr->hint
? hr->hint
: "no hint provided");
- global_ret = 42;
+ global_ret = EXIT_FAILURE;
}
GNUNET_CONTAINER_DLL_remove (dar_head,
dar_tail,
@@ -453,7 +453,7 @@ upload_denomination_add (const char *exchange_url,
err_name,
err_line,
(unsigned int) idx);
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return;
}
@@ -505,7 +505,7 @@ trigger_upload (const char *exchange_url)
{
fprintf (stderr,
"Malformed JSON input\n");
- global_ret = 3;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return;
}
@@ -527,7 +527,7 @@ trigger_upload (const char *exchange_url)
fprintf (stderr,
"Upload does not know how to handle `%s'\n",
key);
- global_ret = 3;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return;
}
@@ -561,7 +561,7 @@ do_upload (char *const *args)
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"auditor",
"PUBLIC_KEY");
- global_ret = 4;
+ global_ret = EXIT_NOTCONFIGURED;
test_shutdown ();
return;
}
@@ -576,7 +576,7 @@ do_upload (char *const *args)
"PUBLIC_KEY",
"invalid key");
GNUNET_free (auditor_public_key_str);
- global_ret = 4;
+ global_ret = EXIT_NOTCONFIGURED;
test_shutdown ();
return;
}
@@ -587,7 +587,7 @@ do_upload (char *const *args)
fprintf (stderr,
"Downloaded data was not consumed, refusing upload\n");
test_shutdown ();
- global_ret = 4;
+ global_ret = EXIT_FAILURE;
return;
}
if (NULL == out)
@@ -606,7 +606,7 @@ do_upload (char *const *args)
err.source,
err.position);
test_shutdown ();
- global_ret = 2;
+ global_ret = EXIT_FAILURE;
return;
}
}
@@ -615,7 +615,7 @@ do_upload (char *const *args)
fprintf (stderr,
"Error: expected JSON array for `upload` command\n");
test_shutdown ();
- global_ret = 2;
+ global_ret = EXIT_FAILURE;
return;
}
if (GNUNET_OK !=
@@ -627,7 +627,7 @@ do_upload (char *const *args)
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"exchange",
"BASE_URL");
- global_ret = 1;
+ global_ret = EXIT_NOTCONFIGURED;
test_shutdown ();
return;
}
@@ -670,7 +670,7 @@ keys_cb (
TALER_EXCHANGE_disconnect (exchange);
exchange = NULL;
test_shutdown ();
- global_ret = 4;
+ global_ret = EXIT_FAILURE;
return;
}
in = json_pack ("{s:s,s:O}",
@@ -712,7 +712,7 @@ do_download (char *const *args)
"exchange",
"BASE_URL");
test_shutdown ();
- global_ret = 1;
+ global_ret = EXIT_NOTCONFIGURED;
return;
}
exchange = TALER_EXCHANGE_connect (ctx,
@@ -795,7 +795,7 @@ show_denomkeys (const json_t *denomkeys)
err_line,
(unsigned int) index);
GNUNET_JSON_parse_free (spec);
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return GNUNET_SYSERR;
}
@@ -821,7 +821,7 @@ show_denomkeys (const json_t *denomkeys)
fprintf (stderr,
"Invalid master signature for key %s (aborting)\n",
TALER_B2S (&h_denom_pub));
- global_ret = 9;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return GNUNET_SYSERR;
}
@@ -907,7 +907,7 @@ parse_keys (const char *command_name)
err.line,
err.source,
err.position);
- global_ret = 2;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return NULL;
}
@@ -926,7 +926,7 @@ parse_keys (const char *command_name)
json_dumpf (in,
stderr,
JSON_INDENT (2));
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return NULL;
}
@@ -985,7 +985,7 @@ do_show (char *const *args)
"Invalid input to 'show': %s#%u (skipping)\n",
err_name,
err_line);
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
json_decref (keys);
return;
@@ -996,7 +996,7 @@ do_show (char *const *args)
{
fprintf (stderr,
"Exchange master public key does not match key we have configured (aborting)\n");
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
json_decref (keys);
return;
@@ -1004,7 +1004,7 @@ do_show (char *const *args)
if (GNUNET_OK !=
show_denomkeys (denomkeys))
{
- global_ret = 8;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
GNUNET_JSON_parse_free (spec);
json_decref (keys);
@@ -1094,7 +1094,7 @@ sign_denomkeys (const json_t *denomkeys)
err_line,
(unsigned int) index);
GNUNET_JSON_parse_free (spec);
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return GNUNET_SYSERR;
}
@@ -1118,7 +1118,7 @@ sign_denomkeys (const json_t *denomkeys)
fprintf (stderr,
"Invalid master signature for key %s (aborting)\n",
TALER_B2S (&h_denom_pub));
- global_ret = 9;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return GNUNET_SYSERR;
}
@@ -1197,7 +1197,7 @@ do_sign (char *const *args)
"Invalid input to 'sign': %s#%u (skipping)\n",
err_name,
err_line);
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
json_decref (keys);
return;
@@ -1208,7 +1208,7 @@ do_sign (char *const *args)
{
fprintf (stderr,
"Exchange master public key does not match key we have configured (aborting)\n");
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
json_decref (keys);
return;
@@ -1218,7 +1218,7 @@ do_sign (char *const *args)
if (GNUNET_OK !=
sign_denomkeys (denomkeys))
{
- global_ret = 8;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
GNUNET_JSON_parse_free (spec);
json_decref (keys);
@@ -1241,7 +1241,7 @@ do_setup (char *const *args)
if (GNUNET_OK !=
load_offline_key (GNUNET_YES))
{
- global_ret = 1;
+ global_ret = EXIT_FAILURE;
return;
}
if (NULL != *args)
@@ -1332,7 +1332,7 @@ work (void *cls)
fprintf (stderr,
"Unexpected command `%s'\n",
args[0]);
- global_ret = 3;
+ global_ret = EXIT_INVALIDARGUMENT;
}
fprintf (stderr,
"Supported subcommands:\n");
@@ -1365,7 +1365,7 @@ run (void *cls,
TALER_config_get_currency (kcfg,
&currency))
{
- global_ret = 1;
+ global_ret = EXIT_NOTCONFIGURED;
return;
}
if (GNUNET_OK !=
@@ -1377,7 +1377,7 @@ run (void *cls,
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"auditor",
"BASE_URL");
- global_ret = 1;
+ global_ret = EXIT_NOTCONFIGURED;
return;
}
{
@@ -1392,7 +1392,7 @@ run (void *cls,
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"exchange",
"MASTER_PUBLIC_KEY");
- global_ret = 1;
+ global_ret = EXIT_NOTCONFIGURED;
return;
}
if (GNUNET_OK !=
@@ -1404,7 +1404,7 @@ run (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Invalid master public key given in exchange configuration.");
GNUNET_free (master_public_key_str);
- global_ret = 1;
+ global_ret = EXIT_NOTCONFIGURED;
return;
}
GNUNET_free (master_public_key_str);
@@ -1446,7 +1446,7 @@ main (int argc,
if (GNUNET_OK !=
GNUNET_STRINGS_get_utf8_args (argc, argv,
&argc, &argv))
- return 4;
+ return EXIT_INVALIDARGUMENT;
ret = GNUNET_PROGRAM_run (
argc, argv,
"taler-auditor-offline",
@@ -1455,9 +1455,9 @@ main (int argc,
&run, NULL);
GNUNET_free_nz ((void *) argv);
if (GNUNET_SYSERR == ret)
- return 3;
+ return EXIT_INVALIDARGUMENT;
if (GNUNET_NO == ret)
- return 0;
+ return EXIT_SUCCESS;
return global_ret;
}
diff --git a/src/exchange-tools/taler-exchange-dbinit.c b/src/exchange-tools/taler-exchange-dbinit.c
index b1d2100df..3f5542b28 100644
--- a/src/exchange-tools/taler-exchange-dbinit.c
+++ b/src/exchange-tools/taler-exchange-dbinit.c
@@ -38,6 +38,7 @@ static int reset_db;
*/
static int gc_db;
+
/**
* Main function that will be run.
*
@@ -62,7 +63,7 @@ run (void *cls,
{
fprintf (stderr,
"Failed to initialize database plugin.\n");
- global_ret = 1;
+ global_ret = EXIT_NOTINSTALLED;
return;
}
if (reset_db)
@@ -79,7 +80,7 @@ run (void *cls,
fprintf (stderr,
"Failed to initialize database.\n");
TALER_EXCHANGEDB_plugin_unload (plugin);
- global_ret = 1;
+ global_ret = EXIT_NOPERMISSION;
return;
}
if (gc_db)
@@ -126,7 +127,7 @@ main (int argc,
if (GNUNET_OK !=
GNUNET_STRINGS_get_utf8_args (argc, argv,
&argc, &argv))
- return 4;
+ return EXIT_INVALIDARGUMENT;
ret = GNUNET_PROGRAM_run (
argc, argv,
"taler-exchange-dbinit",
@@ -135,9 +136,9 @@ main (int argc,
&run, NULL);
GNUNET_free_nz ((void *) argv);
if (GNUNET_SYSERR == ret)
- return 3;
+ return EXIT_INVALIDARGUMENT;
if (GNUNET_NO == ret)
- return 0;
+ return EXIT_SUCCESS;
return global_ret;
}
diff --git a/src/exchange-tools/taler-exchange-offline.c b/src/exchange-tools/taler-exchange-offline.c
index 79b8dd478..3bf8f9810 100644
--- a/src/exchange-tools/taler-exchange-offline.c
+++ b/src/exchange-tools/taler-exchange-offline.c
@@ -821,7 +821,7 @@ denom_revocation_cb (
hr->http_status,
hr->hint,
TALER_JSON_get_error_hint (hr->reply));
- global_ret = 10;
+ global_ret = EXIT_FAILURE;
}
GNUNET_CONTAINER_DLL_remove (drr_head,
drr_tail,
@@ -870,7 +870,7 @@ upload_denom_revocation (const char *exchange_url,
json_dumpf (value,
stderr,
JSON_INDENT (2));
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return;
}
@@ -910,7 +910,7 @@ signkey_revocation_cb (
hr->http_status,
hr->hint,
TALER_JSON_get_error_hint (hr->reply));
- global_ret = 10;
+ global_ret = EXIT_FAILURE;
}
GNUNET_CONTAINER_DLL_remove (srr_head,
srr_tail,
@@ -959,7 +959,7 @@ upload_signkey_revocation (const char *exchange_url,
json_dumpf (value,
stderr,
JSON_INDENT (2));
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return;
}
@@ -998,7 +998,7 @@ auditor_add_cb (void *cls,
hr->http_status,
TALER_ErrorCode_get_hint (hr->ec),
hr->hint);
- global_ret = 10;
+ global_ret = EXIT_FAILURE;
}
GNUNET_CONTAINER_DLL_remove (aar_head,
aar_tail,
@@ -1056,7 +1056,7 @@ upload_auditor_add (const char *exchange_url,
json_dumpf (value,
stderr,
JSON_INDENT (2));
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return;
}
@@ -1098,7 +1098,7 @@ auditor_del_cb (void *cls,
hr->http_status,
TALER_ErrorCode_get_hint (hr->ec),
hr->hint);
- global_ret = 10;
+ global_ret = EXIT_FAILURE;
}
GNUNET_CONTAINER_DLL_remove (adr_head,
adr_tail,
@@ -1150,7 +1150,7 @@ upload_auditor_del (const char *exchange_url,
json_dumpf (value,
stderr,
JSON_INDENT (2));
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return;
}
@@ -1190,7 +1190,7 @@ wire_add_cb (void *cls,
hr->http_status,
TALER_ErrorCode_get_hint (hr->ec),
hr->hint);
- global_ret = 10;
+ global_ret = EXIT_FAILURE;
}
GNUNET_CONTAINER_DLL_remove (war_head,
war_tail,
@@ -1245,7 +1245,7 @@ upload_wire_add (const char *exchange_url,
json_dumpf (value,
stderr,
JSON_INDENT (2));
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return;
}
@@ -1258,7 +1258,7 @@ upload_wire_add (const char *exchange_url,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"payto:// URI `%s' is malformed\n",
payto_uri);
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return;
}
@@ -1301,7 +1301,7 @@ wire_del_cb (void *cls,
hr->http_status,
TALER_ErrorCode_get_hint (hr->ec),
hr->hint);
- global_ret = 10;
+ global_ret = EXIT_FAILURE;
}
GNUNET_CONTAINER_DLL_remove (wdr_head,
wdr_tail,
@@ -1353,7 +1353,7 @@ upload_wire_del (const char *exchange_url,
json_dumpf (value,
stderr,
JSON_INDENT (2));
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return;
}
@@ -1394,7 +1394,7 @@ wire_fee_cb (
hr->http_status,
TALER_ErrorCode_get_hint (hr->ec),
hr->hint);
- global_ret = 10;
+ global_ret = EXIT_FAILURE;
}
GNUNET_CONTAINER_DLL_remove (wfr_head,
wfr_tail,
@@ -1457,7 +1457,7 @@ upload_wire_fee (const char *exchange_url,
json_dumpf (value,
stderr,
JSON_INDENT (2));
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return;
}
@@ -1501,7 +1501,7 @@ keys_cb (
hr->http_status,
TALER_ErrorCode_get_hint (hr->ec),
hr->hint);
- global_ret = 10;
+ global_ret = EXIT_FAILURE;
}
GNUNET_CONTAINER_DLL_remove (ukr_head,
ukr_tail,
@@ -1551,7 +1551,7 @@ upload_keys (const char *exchange_url,
json_dumpf (value,
stderr,
JSON_INDENT (2));
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return;
}
@@ -1644,7 +1644,7 @@ upload_keys (const char *exchange_url,
}
else
{
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
}
GNUNET_free (pkd.sign_sigs);
@@ -1713,7 +1713,7 @@ trigger_upload (const char *exchange_url)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Malformed JSON input\n");
- global_ret = 3;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return;
}
@@ -1735,7 +1735,7 @@ trigger_upload (const char *exchange_url)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Upload does not know how to handle `%s'\n",
key);
- global_ret = 3;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return;
}
@@ -1758,7 +1758,7 @@ do_upload (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Downloaded data was not consumed, refusing upload\n");
test_shutdown ();
- global_ret = 4;
+ global_ret = EXIT_FAILURE;
return;
}
if (NULL == out)
@@ -1777,7 +1777,7 @@ do_upload (char *const *args)
err.source,
err.position);
test_shutdown ();
- global_ret = 2;
+ global_ret = EXIT_FAILURE;
return;
}
}
@@ -1786,7 +1786,7 @@ do_upload (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Error: expected JSON array for `upload` command\n");
test_shutdown ();
- global_ret = 2;
+ global_ret = EXIT_FAILURE;
return;
}
if (GNUNET_OK !=
@@ -1798,7 +1798,7 @@ do_upload (char *const *args)
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"exchange",
"BASE_URL");
- global_ret = 1;
+ global_ret = EXIT_NOTCONFIGURED;
test_shutdown ();
return;
}
@@ -1826,7 +1826,7 @@ do_revoke_denomination_key (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Downloaded data was not consumed, refusing revocation\n");
test_shutdown ();
- global_ret = 4;
+ global_ret = EXIT_FAILURE;
return;
}
if ( (NULL == args[0]) ||
@@ -1839,7 +1839,7 @@ do_revoke_denomination_key (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"You must specify a denomination key with this subcommand\n");
test_shutdown ();
- global_ret = 5;
+ global_ret = EXIT_INVALIDARGUMENT;
return;
}
if (GNUNET_OK !=
@@ -1875,7 +1875,7 @@ do_revoke_signkey (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Downloaded data was not consumed, refusing revocation\n");
test_shutdown ();
- global_ret = 4;
+ global_ret = EXIT_FAILURE;
return;
}
if ( (NULL == args[0]) ||
@@ -1888,7 +1888,7 @@ do_revoke_signkey (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"You must specify an exchange signing key with this subcommand\n");
test_shutdown ();
- global_ret = 5;
+ global_ret = EXIT_INVALIDARGUMENT;
return;
}
if (GNUNET_OK !=
@@ -1926,7 +1926,7 @@ do_add_auditor (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Downloaded data was not consumed, not adding auditor\n");
test_shutdown ();
- global_ret = 4;
+ global_ret = EXIT_FAILURE;
return;
}
if ( (NULL == args[0]) ||
@@ -1939,7 +1939,7 @@ do_add_auditor (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"You must specify an auditor public key as first argument for this subcommand\n");
test_shutdown ();
- global_ret = 5;
+ global_ret = EXIT_INVALIDARGUMENT;
return;
}
@@ -1952,7 +1952,7 @@ do_add_auditor (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"You must specify an auditor URI and auditor name as 2nd and 3rd arguments to this subcommand\n");
test_shutdown ();
- global_ret = 5;
+ global_ret = EXIT_INVALIDARGUMENT;
return;
}
if (GNUNET_OK !=
@@ -1999,7 +1999,7 @@ do_del_auditor (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Downloaded data was not consumed, not deleting auditor account\n");
test_shutdown ();
- global_ret = 4;
+ global_ret = EXIT_FAILURE;
return;
}
if ( (NULL == args[0]) ||
@@ -2012,7 +2012,7 @@ do_del_auditor (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"You must specify an auditor public key as first argument for this subcommand\n");
test_shutdown ();
- global_ret = 5;
+ global_ret = EXIT_INVALIDARGUMENT;
return;
}
if (GNUNET_OK !=
@@ -2055,7 +2055,7 @@ do_add_wire (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Downloaded data was not consumed, not adding wire account\n");
test_shutdown ();
- global_ret = 4;
+ global_ret = EXIT_FAILURE;
return;
}
if (NULL == args[0])
@@ -2063,7 +2063,7 @@ do_add_wire (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"You must specify a payto://-URI with this subcommand\n");
test_shutdown ();
- global_ret = 5;
+ global_ret = EXIT_INVALIDARGUMENT;
return;
}
if (GNUNET_OK !=
@@ -2081,7 +2081,7 @@ do_add_wire (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"payto:// URI `%s' is malformed\n",
args[0]);
- global_ret = 7;
+ global_ret = EXIT_INVALIDARGUMENT;
test_shutdown ();
return;
}
@@ -2125,7 +2125,7 @@ do_del_wire (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Downloaded data was not consumed, not deleting wire account\n");
test_shutdown ();
- global_ret = 4;
+ global_ret = EXIT_FAILURE;
return;
}
if (NULL == args[0])
@@ -2133,7 +2133,7 @@ do_del_wire (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"You must specify a payto://-URI with this subcommand\n");
test_shutdown ();
- global_ret = 5;
+ global_ret = EXIT_INVALIDARGUMENT;
return;
}
if (GNUNET_OK !=
@@ -2181,7 +2181,7 @@ do_set_wire_fee (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Downloaded data was not consumed, not setting wire fee\n");
test_shutdown ();
- global_ret = 4;
+ global_ret = EXIT_FAILURE;
return;
}
if ( (NULL == args[0]) ||
@@ -2204,7 +2204,7 @@ do_set_wire_fee (char *const *args)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"You must use YEAR, METHOD, WIRE-FEE and CLOSING-FEE as arguments for this subcommand\n");
test_shutdown ();
- global_ret = 5;
+ global_ret = EXIT_INVALIDARGUMENT;
return;
}
if (0 == strcasecmp ("now",
@@ -2270,7 +2270,7 @@ download_cb (void *cls,
hr->http_status,
(unsigned int) hr->ec);
test_shutdown ();
- global_ret = 4;
+ global_ret = EXIT_FAILURE;
return;
}
in = json_pack ("{s:s,s:O}",
@@ -2310,7 +2310,7 @@ do_download (char *const *args)
"exchange",
"BASE_URL");
test_shutdown ();
- global_ret = 1;
+ global_ret = EXIT_NOTCONFIGURED;
return;
}
mgkh = TALER_EXCHANGE_get_management_keys (ctx,
@@ -2524,7 +2524,7 @@ show_signkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub,
json_dumpf (value,
stderr,
JSON_INDENT (2));
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return GNUNET_SYSERR;
}
@@ -2540,7 +2540,7 @@ show_signkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Invalid security module signature for signing key %s (aborting)\n",
TALER_B2S (&exchange_pub));
- global_ret = 9;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return GNUNET_SYSERR;
}
@@ -2641,7 +2641,7 @@ show_denomkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub,
stderr,
JSON_INDENT (2));
GNUNET_JSON_parse_free (spec);
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return GNUNET_SYSERR;
}
@@ -2660,7 +2660,7 @@ show_denomkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Invalid security module signature for denomination key %s (aborting)\n",
GNUNET_h2s (&h_denom_pub));
- global_ret = 9;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return GNUNET_SYSERR;
}
@@ -2747,7 +2747,7 @@ parse_keys_input (const char *command_name)
err.line,
err.source,
err.position);
- global_ret = 2;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return NULL;
}
@@ -2766,7 +2766,7 @@ parse_keys_input (const char *command_name)
json_dumpf (in,
stderr,
JSON_INDENT (2));
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return NULL;
}
@@ -2835,7 +2835,7 @@ do_show (char *const *args)
json_dumpf (in,
stderr,
JSON_INDENT (2));
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
json_decref (keys);
return;
@@ -2846,7 +2846,7 @@ do_show (char *const *args)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Fatal: exchange uses different master key!\n");
- global_ret = 6;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
GNUNET_JSON_parse_free (spec);
json_decref (keys);
@@ -2855,7 +2855,7 @@ do_show (char *const *args)
if (GNUNET_SYSERR ==
tofu_check (secm))
{
- global_ret = 8;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
GNUNET_JSON_parse_free (spec);
json_decref (keys);
@@ -2868,7 +2868,7 @@ do_show (char *const *args)
show_denomkeys (&secm[0],
denomkeys)) )
{
- global_ret = 8;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
GNUNET_JSON_parse_free (spec);
json_decref (keys);
@@ -2933,7 +2933,7 @@ sign_signkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub,
json_dumpf (value,
stderr,
JSON_INDENT (2));
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return GNUNET_SYSERR;
}
@@ -2950,7 +2950,7 @@ sign_signkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Invalid security module signature for signing key %s (aborting)\n",
TALER_B2S (&exchange_pub));
- global_ret = 9;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
@@ -3060,7 +3060,7 @@ sign_denomkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub,
stderr,
JSON_INDENT (2));
GNUNET_JSON_parse_free (spec);
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
return GNUNET_SYSERR;
}
@@ -3079,7 +3079,7 @@ sign_denomkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Invalid security module signature for denomination key %s (aborting)\n",
GNUNET_h2s (&h_denom_pub));
- global_ret = 9;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
@@ -3167,7 +3167,7 @@ do_sign (char *const *args)
json_dumpf (in,
stderr,
JSON_INDENT (2));
- global_ret = 7;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
json_decref (keys);
return;
@@ -3178,7 +3178,7 @@ do_sign (char *const *args)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Fatal: exchange uses different master key!\n");
- global_ret = 6;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
GNUNET_JSON_parse_free (spec);
json_decref (keys);
@@ -3189,7 +3189,7 @@ do_sign (char *const *args)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Fatal: security module keys changed!\n");
- global_ret = 8;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
GNUNET_JSON_parse_free (spec);
json_decref (keys);
@@ -3210,7 +3210,7 @@ do_sign (char *const *args)
denomkeys,
denomkey_sig_array)) )
{
- global_ret = 8;
+ global_ret = EXIT_FAILURE;
test_shutdown ();
json_decref (signkey_sig_array);
json_decref (denomkey_sig_array);
@@ -3243,7 +3243,7 @@ do_setup (char *const *args)
if (GNUNET_OK !=
load_offline_key (GNUNET_YES))
{
- global_ret = 1;
+ global_ret = EXIT_NOPERMISSION;
return;
}
if (NULL != *args)
@@ -3373,7 +3373,7 @@ work (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
"Unexpected command `%s'\n",
args[0]);
- global_ret = 3;
+ global_ret = EXIT_INVALIDARGUMENT;
}
GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
"Supported subcommands:\n");
@@ -3406,7 +3406,7 @@ run (void *cls,
TALER_config_get_currency (kcfg,
&currency))
{
- global_ret = 1;
+ global_ret = EXIT_NOTCONFIGURED;
return;
}
ctx = GNUNET_CURL_init (&GNUNET_CURL_gnunet_scheduler_reschedule,
@@ -3446,7 +3446,7 @@ main (int argc,
if (GNUNET_OK !=
GNUNET_STRINGS_get_utf8_args (argc, argv,
&argc, &argv))
- return 4;
+ return EXIT_INVALIDARGUMENT;
ret = GNUNET_PROGRAM_run (
argc, argv,
"taler-exchange-offline",
@@ -3455,9 +3455,9 @@ main (int argc,
&run, NULL);
GNUNET_free_nz ((void *) argv);
if (GNUNET_SYSERR == ret)
- return 3;
+ return EXIT_INVALIDARGUMENT;
if (GNUNET_NO == ret)
- return 0;
+ return EXIT_SUCCESS;
return global_ret;
}