gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: fix sigpipe crash


From: gnunet
Subject: [gnunet] branch master updated: fix sigpipe crash
Date: Sun, 15 Dec 2019 23:29:26 +0100

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

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 4446d990f fix sigpipe crash
4446d990f is described below

commit 4446d990f39b4b39a2988c49faac4d1f8a71e31f
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Dec 15 23:26:12 2019 +0100

    fix sigpipe crash
---
 src/util/gnunet-qr.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/util/gnunet-qr.c b/src/util/gnunet-qr.c
index be28a6e53..cdeea4db1 100644
--- a/src/util/gnunet-qr.c
+++ b/src/util/gnunet-qr.c
@@ -30,7 +30,7 @@
 #include "gnunet_util_lib.h"
 
 #define LOG(fmt, ...)  \
-  if (verbose == true) \
+  if (verbose) \
     printf (fmt, ## __VA_ARGS__)
 
 /**
@@ -41,7 +41,7 @@ static char *device = "/dev/video0";
 /**
  * --verbose option
  */
-static int verbose = false;
+static unsigned int verbose;
 
 /**
  * --silent option
@@ -79,6 +79,11 @@ maint_child_death (void *cls)
   if ((GNUNET_OK != GNUNET_OS_process_status (p, &type, &exit_code)) ||
       (type != GNUNET_OS_PROCESS_EXITED))
     GNUNET_break (0 == GNUNET_OS_process_kill (p, GNUNET_TERM_SIG));
+  if (NULL != sigpipe)
+  {
+    GNUNET_DISK_pipe_close (sigpipe);
+    sigpipe = NULL;
+  }
   GNUNET_OS_process_destroy (p);
 }
 
@@ -126,6 +131,11 @@ gnunet_uri (void *cls,
     return;
   }
   GNUNET_free (subsystem);
+  sigpipe = GNUNET_DISK_pipe (GNUNET_NO,
+                              GNUNET_NO,
+                              GNUNET_NO,
+                              GNUNET_NO);
+  GNUNET_assert (NULL != sigpipe);
   rt = GNUNET_SCHEDULER_add_read_file (
     GNUNET_TIME_UNIT_FOREVER_REL,
     GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ),

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



reply via email to

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