Solaris based operating systems don't define MSG_NOSIGNAL and SO_NOSIGPIPE.

They return SIGPIPE when send is used with a closed socket. A SIGPIPE handler
must be used or SIGPIPE should be set ignored with SIG_IGN. In this case send
returns -1 instead of a SIGPIPE. The setting to ignore SIGPIPE is global and
should be used only where it is absolutely necessary.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
array: add a mechanism to get a callback when a bin is allocated

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
LOG: use the array callback to register new callsites

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
LOG: don't break on empty callsites, just ignore them

else we might miss some callsites.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
LOG: make the format comparison safe and sane

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
IPC: Pass the timeout to poll() if the recv function returns EAGAIN
Bump the library version.

Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
TEST: fix typo s/,/; in check_ipc.c

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
example: check for error in qb_ipc_run()

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
example/test: check for error in qb_ipc_run()

Hopefully all of them this time.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Make sure that mmap'ed files smaller than a page size are written to.

This is a test to make sure that there is actually enough memory
to back the requested shared memory.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
IPC: set the error more correctly when qb_sys_mmap_file_open() fails.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Remove extra ";"

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
IPC: call poll if we are mid message and get EAGAIN

So just manually call us_ready (poll) with a timeout of 50ms
to prevent cpu spin.

Also update qb_ipc_us_recv() to be simerlar.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
LOG: set the return code when calloc fails

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
LOG: fix the format comparison to avoid generating multiple entries.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
ptrie: deref the current node in trie_iter_free()

If free'ing the iterator before getting to the last
node make sure we de-ref the current node. Else we
will not be able to delete the node.

fixes #44

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Make sure we don't use the format string whilst it is getting changed.

Just add a rwlock around the usage.
Move qb_log_format_set() to log_format.c to make this easier.

Fixes #45

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
IPC: don't over log on disconnect

Thanks grueni: https://github.com/asalkeld/libqb/pull/43

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Fix strlcpy and strlcat functions

These were not behaving as the man pages described.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>