[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant] branch master updated: fix compilation due
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant] branch master updated: fix compilation due to code move |
Date: |
Sat, 22 Apr 2017 00:00:02 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new 002bae7 fix compilation due to code move
002bae7 is described below
commit 002bae744c7307fb86d7ff52f62be5b9a1d85a31
Author: Marcello Stanisci <address@hidden>
AuthorDate: Fri Apr 21 20:03:28 2017 +0200
fix compilation due to code move
---
src/samples/generate_payments.c | 203 +++++++++++++++++++++-------------------
1 file changed, 108 insertions(+), 95 deletions(-)
diff --git a/src/samples/generate_payments.c b/src/samples/generate_payments.c
index 5a071a5..e5b31f7 100644
--- a/src/samples/generate_payments.c
+++ b/src/samples/generate_payments.c
@@ -27,6 +27,16 @@
#include <microhttpd.h>
/**
+ * The exchange process launched by the generator
+ */
+static struct GNUNET_OS_Process *exchanged;
+
+/**
+ * The merchant process launched by the generator
+ */
+static struct GNUNET_OS_Process *merchantd;
+
+/**
* How many times the command list should be rerun.
*/
static unsigned int times = 1;
@@ -1360,6 +1370,8 @@ run (void *cls,
{
int ncmds;
struct InterpreterState *is;
+ unsigned int cnt;
+ char *wget_cmd;
if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (config,
"payments-generator",
@@ -1422,6 +1434,102 @@ run (void *cls,
return;
}
+ if (!remote_exchange)
+ {
+ exchanged = GNUNET_OS_start_process (GNUNET_NO,
+ GNUNET_OS_INHERIT_STD_ALL,
+ NULL, NULL, NULL,
+ "taler-exchange-httpd",
+ "taler-exchange-httpd",
+ NULL);
+ if (NULL == exchanged)
+ {
+ fprintf (stderr,
+ "Failed to run taler-exchange-httpd. Check your PATH.\n");
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+
+ fprintf (stderr,
+ "Waiting for taler-exchange-httpd to be ready\n");
+ cnt = 0;
+
+ GNUNET_asprintf (&wget_cmd, "wget -q -t 1 -T 1 %skeys -o /dev/null -O
/dev/null", exchange_uri);
+
+ do
+ {
+ fprintf (stderr, ".");
+ sleep (1);
+ cnt++;
+ if (cnt > 60)
+ {
+ fprintf (stderr,
+ "\nFailed to start taler-exchange-httpd\n");
+ GNUNET_OS_process_kill (exchanged,
+ SIGKILL);
+ GNUNET_OS_process_wait (exchanged);
+ GNUNET_OS_process_destroy (exchanged);
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ }
+ while (0 != system (wget_cmd));
+ GNUNET_free (wget_cmd);
+
+ fprintf (stderr, "\n");
+ }
+
+ merchantd = GNUNET_OS_start_process (GNUNET_NO,
+ GNUNET_OS_INHERIT_STD_ALL,
+ NULL, NULL, NULL,
+ "taler-merchant-httpd",
+ "taler-merchant-httpd",
+ "-L", "DEBUG",
+ NULL);
+ if (NULL == merchantd)
+ {
+ fprintf (stderr,
+ "Failed to run taler-merchant-httpd. Check your PATH.\n");
+ GNUNET_OS_process_kill (exchanged,
+ SIGKILL);
+ GNUNET_OS_process_wait (exchanged);
+ GNUNET_OS_process_destroy (exchanged);
+
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ /* give child time to start and bind against the socket */
+ fprintf (stderr,
+ "Waiting for taler-merchant-httpd to be ready\n");
+ cnt = 0;
+ GNUNET_asprintf (&wget_cmd, "wget -q -t 1 -T 1 %s -o /dev/null -O
/dev/null", merchant_uri);
+
+ do
+ {
+ fprintf (stderr, ".");
+ sleep (1);
+ cnt++;
+ if (cnt > 60)
+ {
+ fprintf (stderr,
+ "\nFailed to start taler-merchant-httpd\n");
+ GNUNET_OS_process_kill (merchantd,
+ SIGKILL);
+ GNUNET_OS_process_wait (merchantd);
+ GNUNET_OS_process_destroy (merchantd);
+ GNUNET_OS_process_kill (exchanged,
+ SIGKILL);
+ GNUNET_OS_process_wait (exchanged);
+ GNUNET_OS_process_destroy (exchanged);
+
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ }
+ while (0 != system (wget_cmd));
+ fprintf (stderr, "\n");
+ GNUNET_free (wget_cmd);
+
/* must always be updated with the # of cmds the interpreter has*/
ncmds = 13;
struct Command commands[] =
@@ -1546,12 +1654,7 @@ int
main (int argc,
char *argv[])
{
-
- struct GNUNET_OS_Process *exchanged = NULL;
- struct GNUNET_OS_Process *merchantd;
- unsigned int cnt;
struct GNUNET_SIGNAL_Context *shc_chld;
- char *wget_cmd;
GNUNET_log_setup ("merchant-create-payments",
"DEBUG",
@@ -1574,96 +1677,6 @@ main (int argc,
unsetenv ("XDG_DATA_HOME");
unsetenv ("XDG_CONFIG_HOME");
- if (!remote_exchange)
- {
- exchanged = GNUNET_OS_start_process (GNUNET_NO,
- GNUNET_OS_INHERIT_STD_ALL,
- NULL, NULL, NULL,
- "taler-exchange-httpd",
- "taler-exchange-httpd",
- NULL);
- if (NULL == exchanged)
- {
- fprintf (stderr,
- "Failed to run taler-exchange-httpd. Check your PATH.\n");
- return 77;
- }
-
- fprintf (stderr,
- "Waiting for taler-exchange-httpd to be ready\n");
- cnt = 0;
-
- GNUNET_asprintf (&wget_cmd, "wget -q -t 1 -T 1 %skeys -o /dev/null -O
/dev/null", exchange_uri);
-
- do
- {
- fprintf (stderr, ".");
- sleep (1);
- cnt++;
- if (cnt > 60)
- {
- fprintf (stderr,
- "\nFailed to start taler-exchange-httpd\n");
- GNUNET_OS_process_kill (exchanged,
- SIGKILL);
- GNUNET_OS_process_wait (exchanged);
- GNUNET_OS_process_destroy (exchanged);
- return 77;
- }
- }
- while (0 != system (wget_cmd));
- GNUNET_free (wget_cmd);
-
- fprintf (stderr, "\n");
- }
-
- merchantd = GNUNET_OS_start_process (GNUNET_NO,
- GNUNET_OS_INHERIT_STD_ALL,
- NULL, NULL, NULL,
- "taler-merchant-httpd",
- "taler-merchant-httpd",
- "-L", "DEBUG",
- NULL);
- if (NULL == merchantd)
- {
- fprintf (stderr,
- "Failed to run taler-merchant-httpd. Check your PATH.\n");
- GNUNET_OS_process_kill (exchanged,
- SIGKILL);
- GNUNET_OS_process_wait (exchanged);
- GNUNET_OS_process_destroy (exchanged);
- return 77;
- }
- /* give child time to start and bind against the socket */
- fprintf (stderr,
- "Waiting for taler-merchant-httpd to be ready\n");
- cnt = 0;
- GNUNET_asprintf (&wget_cmd, "wget -q -t 1 -T 1 %s -o /dev/null -O
/dev/null", merchant_uri);
-
- do
- {
- fprintf (stderr, ".");
- sleep (1);
- cnt++;
- if (cnt > 60)
- {
- fprintf (stderr,
- "\nFailed to start taler-merchant-httpd\n");
- GNUNET_OS_process_kill (merchantd,
- SIGKILL);
- GNUNET_OS_process_wait (merchantd);
- GNUNET_OS_process_destroy (merchantd);
- GNUNET_OS_process_kill (exchanged,
- SIGKILL);
- GNUNET_OS_process_wait (exchanged);
- GNUNET_OS_process_destroy (exchanged);
- return 77;
- }
- }
- while (0 != system (wget_cmd));
- fprintf (stderr, "\n");
- GNUNET_free (wget_cmd);
-
result = GNUNET_SYSERR;
sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_NO);
GNUNET_assert (NULL != sigpipe);
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant] branch master updated: fix compilation due to code move,
gnunet <=