From ed937dd3058b10e0ec5fdcffd93dc2c2a7f2c2da Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 22 Aug 2015 00:38:50 +0200 Subject: typo + mds-colour: print colour list on SIGINFO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libmdsserver/hash-list.h | 2 +- src/mds-colour.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libmdsserver/hash-list.h b/src/libmdsserver/hash-list.h index dfc4489..fcd9eb4 100644 --- a/src/libmdsserver/hash-list.h +++ b/src/libmdsserver/hash-list.h @@ -507,7 +507,7 @@ T##_unmarshal(T##_t* restrict this, char* restrict data)\ */ #define foreach_hash_list_entry(this, i, entry) \ for (i = 0; i < (this).used; i++) \ - if (entry = (this).slots, entry->keys != NULL) + if (entry = (this).slots, entry->key != NULL) #endif diff --git a/src/mds-colour.c b/src/mds-colour.c index 2bee831..c5151dc 100644 --- a/src/mds-colour.c +++ b/src/mds-colour.c @@ -477,10 +477,18 @@ int handle_set_colour(const char* recv_name, const char* recv_remove, const char */ void received_info(int signo) { + size_t i; + colour_list_entry_t* entry; (void) signo; iprintf("next message ID: %" PRIu32, message_id); iprintf("connected: %s", connected ? "yes" : "no"); iprintf("send buffer size: %zu bytes", send_buffer_size); + iprint("DEFINED COLOURS (bytes red green blue name-hash name)"); + foreach_hash_list_entry (colours, i, entry) + iprintf("%i %"PRIu64" %"PRIu64" %"PRIu64" %zu %s", + entry->value.bytes, entry->value.red, entry->value.green, + entry->value.blue, entry->key_hash, entry->key); + iprint("END DEFINED COLOURS"); } -- cgit v1.2.3-70-g09d2