The flight recorder records all data in 32 bit words. Use uint32_t type
rather then unsigned int. Also remove bit-shift with multiply by sizeof
uint32_t.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
Corrupted files may contain items with rec_size larger then g_record
buffer and/or flt_data_size.
Also g_record array size is now defined as constant.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
The flight recoder buffer size as specified in LOGSYS_DECLARE_SYSTEM
or _logsys_rec_init was expressed in number of ints. A developer asking
to allocate 512K would get a 2M allocation on a machine with sizeof(int) = 4.
This is confusing and the patch addresses it:
- rename rec_size to fltsize for external API (no type change),
because rec_size is used many times internally for other reasons
and it can be confusing.
- rename size to fltsize in _logsys_rec_init.
- document what we allocate and why.
- swap comments around to match the code.
- introduce a simple macro to perform rounding (stolen from linux-2.6.git).
- start shaping fdata header to better handle dynamic values:
* write the flt_data_size as first unsigned int the header.
* change corosync-fplay to read the value and alloc the right amount
of memory instead of hardcoding it again.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2255 fd59a12c-fef9-0310-b244-a6a79926bd2f
- services/Makefile.am: add include search paths for config.h
- include/corosync/cs_config.h.in exports LCRSODIR and SOCKETDIR
- tools/Makefile.am: drop -D defines for dirs that are now in
cs_config.h or config.h
- configure.ac: sanitize prefix and exec_prefix paths. Export DIRS in
*config.h
- lib/Makefile.am: : drop -D defines for dirs that are now in
cs_config.h or config.h. Add rule to build lcr_ifact.o or building from
lib/ fails miserably
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1877 fd59a12c-fef9-0310-b244-a6a79926bd2f
If we don't care about the return value then typecase the return
value to void.
Else do something useful with the return value.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1693 fd59a12c-fef9-0310-b244-a6a79926bd2f