LOG: copy the function/filename for dynamic callsites

callsites originate from the assumption that the function/filename/format
are all statically allocated. When moving to dynamic callsite we kept
this assumption. But people are now passing in function/file names that
later get free'd. So we need to make sure that they stay persistant by
allocating them ourselves.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
IPC: fix the connection state checking
Merge pull request #58 from inouekazu/fix_connection_state_checking

IPC: fix the connection state checking

Make sure the case when qb_ipc_us_ready() returns 0 is handled.
Deal better with corrupt blackbox files.

fixes #59
Thanks to Jan Friesse for the reproducer.
https://github.com/jfriesse/csts/blob/master/tests/fplay-segfault.sh

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
add file_change_bytes into check_PROGRAMS and fix a typo
Merge pull request #60 from t-matsuo/fix-makefile-of-tests

add file_change_bytes into check_PROGRAMS and fix a typo
Fix make distcheck

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Remove doxygen from travis deps to try and get the job working.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Fix "make srpm"

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Typo fixed in configure

Hello.
Indicate when/why qb_rb_force_close() fails to remove share memory files
IPC: make each connection ref the owning service

This is because the connection functions use the c->service pointer
and this needs to be mirrored in the reference counting.

The service can only be free'd when all connections are destroyed
and the user as unreferenced all previously referenced connections
and the service.

Fixes #62
Thanks to Jan Friesse for the reproducer
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Remove some test code mistakenly committed to the example program.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
ringbuffer: use atomic ops on ringbuffer chunk magic

The ringbuffer protocol uses the chunk magic number to indicate to the
other side what state a chunk is in.  It's therefore important to use
strongly ordered memory writes to make sure that neither the compiler
nor the CPU change the apparent order of the writes, since that would
result in corrupted messages.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Rename the configure macros from atomic to sync

This is so I can add support for the new atomic's which
are named __atomic.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Add internal support for the new __atomic gcc builtins

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Use the new atomic ops in the ringbuffer

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Add atomic_int.h to noinst_HEADERS

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Enable distcheck on the travis tests

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Add a IPC service context pointer and accessors from both the connection and service level.