gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r12404 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r12404 - gnunet/src/util
Date: Fri, 30 Jul 2010 13:38:16 +0200

Author: nevans
Date: 2010-07-30 13:38:16 +0200 (Fri, 30 Jul 2010)
New Revision: 12404

Modified:
   gnunet/src/util/common_logging.c
   gnunet/src/util/scheduler.c
Log:
ignore sigpipe

Modified: gnunet/src/util/common_logging.c
===================================================================
--- gnunet/src/util/common_logging.c    2010-07-30 11:10:45 UTC (rev 12403)
+++ gnunet/src/util/common_logging.c    2010-07-30 11:38:16 UTC (rev 12404)
@@ -478,6 +478,22 @@
   return (const char *) ret.encoding;
 }
 
+/**
+ * Convert a hash to a string (for printing debug messages).
+ * This is one of the very few calls in the entire API that is
+ * NOT reentrant!
+ *
+ * @param hc the hash code
+ * @return string form; will be overwritten by next call to GNUNET_h2s_full.
+ */
+const char *
+GNUNET_h2s_full (const GNUNET_HashCode * hc)
+{
+  static struct GNUNET_CRYPTO_HashAsciiEncoded ret;
+  GNUNET_CRYPTO_hash_to_enc (hc, &ret);
+  ret.encoding[104] = '\0';
+  return (const char *) ret.encoding;
+}
 
 /**
  * Convert a peer identity to a string (for printing debug messages).

Modified: gnunet/src/util/scheduler.c
===================================================================
--- gnunet/src/util/scheduler.c 2010-07-30 11:10:45 UTC (rev 12403)
+++ gnunet/src/util/scheduler.c 2010-07-30 11:38:16 UTC (rev 12404)
@@ -623,6 +623,16 @@
  */
 static struct GNUNET_DISK_PipeHandle *sigpipe;
 
+/**
+ * Signal handler called for sigpipe.
+ *
+ * FIXME: what should we do here?
+ */
+static void
+sighandler_pipe ()
+{
+  return;
+}
 
 /**
  * Signal handler called for signals that should cause us to shutdown.
@@ -664,6 +674,7 @@
   struct GNUNET_SIGNAL_Context *shc_term;
   struct GNUNET_SIGNAL_Context *shc_quit;
   struct GNUNET_SIGNAL_Context *shc_hup;
+  struct GNUNET_SIGNAL_Context *shc_pipe;
   unsigned long long last_tr;
   unsigned int busy_wait_warning;
   const struct GNUNET_DISK_FileHandle *pr;
@@ -676,6 +687,7 @@
   GNUNET_assert (sigpipe != NULL);
   pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
   GNUNET_assert (pr != NULL);
+  shc_pipe = GNUNET_SIGNAL_handler_install (SIGPIPE, &sighandler_pipe);
   shc_int = GNUNET_SIGNAL_handler_install (SIGINT, &sighandler_shutdown);
   shc_term = GNUNET_SIGNAL_handler_install (SIGTERM, &sighandler_shutdown);
 #ifndef MINGW




reply via email to

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