gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: enable stdin for -f


From: gnunet
Subject: [taler-exchange] branch master updated: enable stdin for -f
Date: Sun, 19 Jan 2020 22:30:54 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new e5b92f8b enable stdin for -f
e5b92f8b is described below

commit e5b92f8b5effeb0e3c6f42de3776870bfc1bd0b9
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Jan 19 22:30:52 2020 +0100

    enable stdin for -f
---
 src/exchange/taler-exchange-httpd.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd.c 
b/src/exchange/taler-exchange-httpd.c
index 1c929046..e2d3680c 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -632,7 +632,11 @@ run_fake_client ()
   int ret;
   int status;
 
-  fd = open (input_filename, O_RDONLY);
+  if (0 == strcmp (input_filename,
+                   "-"))
+    fd = 0;
+  else
+    fd = open (input_filename, O_RDONLY);
   if (-1 == fd)
   {
     fprintf (stderr,
@@ -672,9 +676,13 @@ run_fake_client ()
     _exit (1);
   }
   /* parent process */
-  GNUNET_break (0 == close (fd));
+  if (0 != strcmp (input_filename,
+                   "-"))
+    GNUNET_break (0 == close (fd));
   ret = TEH_KS_loop ();
-  if (cld != waitpid (cld, &status, 0))
+  if (cld != waitpid (cld,
+                      &status,
+                      0))
     fprintf (stderr,
              "Waiting for `nc' child failed: %s\n",
              strerror (errno));
@@ -802,7 +810,7 @@ main (int argc,
     GNUNET_GETOPT_option_filename ('f',
                                    "file-input",
                                    "FILENAME",
-                                   "run in test-mode using FILENAME as the 
HTTP request to process",
+                                   "run in test-mode using FILENAME as the 
HTTP request to process, use '-' to read from stdin",
                                    &input_filename),
 #endif
     GNUNET_GETOPT_option_help (

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]