don't block completely on the sem_wait(), but chop the waits
into 1 sec blocks so the destroy can have an opertunity to complete.
fixes bug #55
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Seperate into a setup file and a socket backend file, it was getting messy
and confusing. Also preparing for using DGRAM sockets.
This should not result in any logical changes.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
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>
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>
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>
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>
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>
Linux doesn't pass credential information by default, only when it has
been specifically requested with SO_PASSCRED. This means there's a
race between when the ipc server side has set up and is listening on the
socket, and when the client may connect; if the client connects and sends
its first message before the server has set SO_PASSCRED on the socket,
then there will be no ucred information associated with the message.
The fix is to set SO_PASSCRED on the client socket as well, so that
the message will always have a ucred associated with it when the server
reads it.
Without this change, around 1% of cpg_model_initialize() calls fail
with CS_ERR_ACCESS.
(This Linux behaviour was introduced just on a year ago in
16e5726269611b71c930054ffe9b858c1cea88eb "af_unix: dont send
SCM_CREDENTIALS by default".)
the strlcat was not call correctly, it needs the
original string to find the end and return the
correct length.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Two issues:
1. when writing out the function name length, don't just write the 4 MSB
of the size
2. when reading the time, don't just use the 4 MSB of the time as the
timestamp; the log contains a full time_t, so we may as well use it.