libmultipath: Improve debugging of log messages
authorHannes Reinecke <hare@suse.de>
Wed, 12 Jan 2011 09:07:58 +0000 (10:07 +0100)
committerHannes Reinecke <hare@suse.de>
Tue, 17 May 2011 10:36:48 +0000 (12:36 +0200)
With the current definition of log messages we
only see something utterly pointless when using
gdb:
(gdb) print *(struct logmsg *)la->buff
$15 = {prio = 6, next = 0x80015a68,
  str = 0x73687574646f776e <Address 0x73687574646f776e out of bounds>}

With this fix we are able to see the message
directly:

(gdb) print *(struct logmsg *)la->buff
$6 = {prio = 5, next = 0x8001b220,
  str = 0x8001d240 "--------shut down-------\n"}

References: bnc#659859

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath/log.h

index c697118..3fd1677 100644 (file)
@@ -17,7 +17,7 @@
 struct logmsg {
        short int prio;
        void * next;
-       char * str;
+       char str[0];
 };
 
 struct logarea {