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).
*/
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.
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;
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