summaryrefslogtreecommitdiff
path: root/src/auditor
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-01-07 20:52:11 +0100
committerChristian Grothoff <christian@grothoff.org>2021-01-07 20:52:11 +0100
commit9473ef4d86d8029237c018c72bf6311a3fe54987 (patch)
tree4365491f65d07afa76d16fe5af6f5e73d31348ee /src/auditor
parentb2d8799af1b09b67779df3fd71b84ec59f7e9f7e (diff)
downloadexchange-9473ef4d86d8029237c018c72bf6311a3fe54987.tar.gz
exchange-9473ef4d86d8029237c018c72bf6311a3fe54987.tar.bz2
exchange-9473ef4d86d8029237c018c72bf6311a3fe54987.zip
fix remaining #6679 issues in exchange
Diffstat (limited to 'src/auditor')
-rw-r--r--src/auditor/taler-auditor-dbinit.c25
-rw-r--r--src/auditor/taler-auditor-exchange.c15
-rw-r--r--src/auditor/taler-auditor-httpd.c15
-rw-r--r--src/auditor/taler-helper-auditor-aggregation.c4
-rw-r--r--src/auditor/taler-helper-auditor-coins.c29
-rw-r--r--src/auditor/taler-helper-auditor-deposits.c30
-rw-r--r--src/auditor/taler-helper-auditor-reserves.c29
-rw-r--r--src/auditor/taler-helper-auditor-wire.c30
8 files changed, 107 insertions, 70 deletions
diff --git a/src/auditor/taler-auditor-dbinit.c b/src/auditor/taler-auditor-dbinit.c
index 99ef96f8..d0509fc0 100644
--- a/src/auditor/taler-auditor-dbinit.c
+++ b/src/auditor/taler-auditor-dbinit.c
@@ -134,22 +134,27 @@ main (int argc,
&gc_db),
GNUNET_GETOPT_OPTION_END
};
+ enum GNUNET_GenericReturnValue ret;
/* force linker to link against libtalerutil; if we do
not do this, the linker may "optimize" libtalerutil
away and skip #TALER_OS_init(), which we do need */
(void) TALER_project_data_default ();
- GNUNET_assert (GNUNET_OK ==
- GNUNET_log_setup ("taler-auditor-dbinit",
- "INFO",
- NULL));
if (GNUNET_OK !=
- GNUNET_PROGRAM_run (argc, argv,
- "taler-auditor-dbinit",
- "Initialize Taler auditor database",
- options,
- &run, NULL))
- return 1;
+ GNUNET_STRINGS_get_utf8_args (argc, argv,
+ &argc, &argv))
+ return 4;
+ ret = GNUNET_PROGRAM_run (
+ argc, argv,
+ "taler-auditor-dbinit",
+ gettext_noop ("Initialize Taler auditor database"),
+ options,
+ &run, NULL);
+ GNUNET_free_nz ((void *) argv);
+ if (GNUNET_SYSERR == ret)
+ return 3;
+ if (GNUNET_NO == ret)
+ return 0;
return global_ret;
}
diff --git a/src/auditor/taler-auditor-exchange.c b/src/auditor/taler-auditor-exchange.c
index 2091031c..238cc59a 100644
--- a/src/auditor/taler-auditor-exchange.c
+++ b/src/auditor/taler-auditor-exchange.c
@@ -92,10 +92,17 @@ main (int argc,
GNUNET_log_setup ("taler-auditor-exchange",
"WARNING",
NULL));
- if (GNUNET_GETOPT_run ("taler-auditor-exchange",
- options,
- argc, argv) <= 0)
- return 1;
+ {
+ enum GNUNET_GenericReturnValue ret;
+
+ ret = GNUNET_GETOPT_run ("taler-auditor-exchange",
+ options,
+ argc, argv);
+ if (GNUNET_NO == ret)
+ return 0;
+ if (GNUNET_OK != ret)
+ return 1;
+ }
if (NULL == cfgfile)
cfgfile = GNUNET_strdup (GNUNET_OS_project_data_get ()->user_config_file);
cfg = GNUNET_CONFIGURATION_create ();
diff --git a/src/auditor/taler-auditor-httpd.c b/src/auditor/taler-auditor-httpd.c
index 1f6413b2..aac6d8a8 100644
--- a/src/auditor/taler-auditor-httpd.c
+++ b/src/auditor/taler-auditor-httpd.c
@@ -569,11 +569,18 @@ main (int argc,
int fh = -1;
enum TALER_MHD_GlobalOptions go;
- if (0 >=
- GNUNET_GETOPT_run ("taler-auditor-httpd",
- options,
- argc, argv))
+ {
+ enum GNUNET_GenericReturnValue ret;
+
+ ret = GNUNET_GETOPT_run ("taler-auditor-httpd",
+ options,
+ argc, argv);
+ if (GNUNET_NO == ret)
+ return 0;
+ if (GNUNET_SYSERR == ret)
+ return 3;
return 1;
+ }
go = TALER_MHD_GO_NONE;
if (auditor_connection_close)
go |= TALER_MHD_GO_FORCE_CONNECTION_CLOSE;
diff --git a/src/auditor/taler-helper-auditor-aggregation.c b/src/auditor/taler-helper-auditor-aggregation.c
index 830773c7..27c67ea5 100644
--- a/src/auditor/taler-helper-auditor-aggregation.c
+++ b/src/auditor/taler-helper-auditor-aggregation.c
@@ -1490,10 +1490,6 @@ main (int argc,
GNUNET_STRINGS_get_utf8_args (argc, argv,
&argc, &argv))
return 4;
- GNUNET_assert (GNUNET_OK ==
- GNUNET_log_setup ("taler-helper-auditor-aggregation",
- "MESSAGE",
- NULL));
ret = GNUNET_PROGRAM_run (
argc,
argv,
diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c
index bceb0419..7b91e77b 100644
--- a/src/auditor/taler-helper-auditor-coins.c
+++ b/src/auditor/taler-helper-auditor-coins.c
@@ -2760,24 +2760,29 @@ main (int argc,
"timetravel"),
GNUNET_GETOPT_OPTION_END
};
+ enum GNUNET_GenericReturnValue ret;
/* force linker to link against libtalerutil; if we do
not do this, the linker may "optimize" libtalerutil
away and skip #TALER_OS_init(), which we do need */
(void) TALER_project_data_default ();
- GNUNET_assert (GNUNET_OK ==
- GNUNET_log_setup ("taler-helper-auditor-coins",
- "MESSAGE",
- NULL));
if (GNUNET_OK !=
- GNUNET_PROGRAM_run (argc,
- argv,
- "taler-helper-auditor-coins",
- "Audit Taler coin processing",
- options,
- &run,
- NULL))
- return 1;
+ GNUNET_STRINGS_get_utf8_args (argc, argv,
+ &argc, &argv))
+ return 4;
+ ret = GNUNET_PROGRAM_run (
+ argc,
+ argv,
+ "taler-helper-auditor-coins",
+ gettext_noop ("Audit Taler coin processing"),
+ options,
+ &run,
+ NULL);
+ GNUNET_free_nz ((void *) argv);
+ if (GNUNET_SYSERR == ret)
+ return 3;
+ if (GNUNET_NO == ret)
+ return 0;
return global_ret;
}
diff --git a/src/auditor/taler-helper-auditor-deposits.c b/src/auditor/taler-helper-auditor-deposits.c
index 1c012831..6bf94589 100644
--- a/src/auditor/taler-helper-auditor-deposits.c
+++ b/src/auditor/taler-helper-auditor-deposits.c
@@ -360,24 +360,30 @@ main (int argc,
"timetravel"),
GNUNET_GETOPT_OPTION_END
};
+ enum GNUNET_GenericReturnValue ret;
/* force linker to link against libtalerutil; if we do
not do this, the linker may "optimize" libtalerutil
away and skip #TALER_OS_init(), which we do need */
(void) TALER_project_data_default ();
- GNUNET_assert (GNUNET_OK ==
- GNUNET_log_setup ("taler-helper-auditor-deposits",
- "MESSAGE",
- NULL));
if (GNUNET_OK !=
- GNUNET_PROGRAM_run (argc,
- argv,
- "taler-helper-auditor-deposits",
- "Audit Taler exchange database for deposit confirmation consistency",
- options,
- &run,
- NULL))
- return 1;
+ GNUNET_STRINGS_get_utf8_args (argc, argv,
+ &argc, &argv))
+ return 4;
+ ret = GNUNET_PROGRAM_run (
+ argc,
+ argv,
+ "taler-helper-auditor-deposits",
+ gettext_noop (
+ "Audit Taler exchange database for deposit confirmation consistency"),
+ options,
+ &run,
+ NULL);
+ GNUNET_free_nz ((void *) argv);
+ if (GNUNET_SYSERR == ret)
+ return 3;
+ if (GNUNET_NO == ret)
+ return 0;
return global_ret;
}
diff --git a/src/auditor/taler-helper-auditor-reserves.c b/src/auditor/taler-helper-auditor-reserves.c
index 8b49f747..8e53214f 100644
--- a/src/auditor/taler-helper-auditor-reserves.c
+++ b/src/auditor/taler-helper-auditor-reserves.c
@@ -1677,24 +1677,29 @@ main (int argc,
"timetravel"),
GNUNET_GETOPT_OPTION_END
};
+ enum GNUNET_GenericReturnValue ret;
/* force linker to link against libtalerutil; if we do
not do this, the linker may "optimize" libtalerutil
away and skip #TALER_OS_init(), which we do need */
(void) TALER_project_data_default ();
- GNUNET_assert (GNUNET_OK ==
- GNUNET_log_setup ("taler-helper-auditor-reserves",
- "MESSAGE",
- NULL));
if (GNUNET_OK !=
- GNUNET_PROGRAM_run (argc,
- argv,
- "taler-helper-auditor-reserves",
- "Audit Taler exchange reserve handling",
- options,
- &run,
- NULL))
- return 1;
+ GNUNET_STRINGS_get_utf8_args (argc, argv,
+ &argc, &argv))
+ return 4;
+ ret = GNUNET_PROGRAM_run (
+ argc,
+ argv,
+ "taler-helper-auditor-reserves",
+ gettext_noop ("Audit Taler exchange reserve handling"),
+ options,
+ &run,
+ NULL);
+ GNUNET_free_nz ((void *) argv);
+ if (GNUNET_SYSERR == ret)
+ return 3;
+ if (GNUNET_NO == ret)
+ return 0;
return global_ret;
}
diff --git a/src/auditor/taler-helper-auditor-wire.c b/src/auditor/taler-helper-auditor-wire.c
index 128eba81..fc91048a 100644
--- a/src/auditor/taler-helper-auditor-wire.c
+++ b/src/auditor/taler-helper-auditor-wire.c
@@ -2183,24 +2183,30 @@ main (int argc,
"timetravel"),
GNUNET_GETOPT_OPTION_END
};
+ enum GNUNET_GenericReturnValue ret;
/* force linker to link against libtalerutil; if we do
not do this, the linker may "optimize" libtalerutil
away and skip #TALER_OS_init(), which we do need */
(void) TALER_project_data_default ();
- GNUNET_assert (GNUNET_OK ==
- GNUNET_log_setup ("taler-helper-auditor-wire",
- "MESSAGE",
- NULL));
if (GNUNET_OK !=
- GNUNET_PROGRAM_run (argc,
- argv,
- "taler-helper-auditor-wire",
- "Audit exchange database for consistency with the bank's wire transfers",
- options,
- &run,
- NULL))
- return 1;
+ GNUNET_STRINGS_get_utf8_args (argc, argv,
+ &argc, &argv))
+ return 4;
+ ret = GNUNET_PROGRAM_run (
+ argc,
+ argv,
+ "taler-helper-auditor-wire",
+ gettext_noop (
+ "Audit exchange database for consistency with the bank's wire transfers"),
+ options,
+ &run,
+ NULL);
+ GNUNET_free_nz ((void *) argv);
+ if (GNUNET_SYSERR == ret)
+ return 3;
+ if (GNUNET_NO == ret)
+ return 0;
return global_ret;
}