Jeremy Fitzhardinge
30139366ed
blackbox: fix 64-bit big-endian issues
...
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.
2012-08-31 13:21:00 -07:00
Angus Salkeld
c7810b38b1
Remove IPC_NEEDS_RESPONSE_ACK and turn off shm ipc on solaris
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-31 14:53:38 +10:00
Angus Salkeld
ffcb11f93d
Some improvements to kqueue usage.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-31 13:32:11 +10:00
Angus Salkeld
b6e0b5b431
kqueue: drop log message to trace.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-30 23:12:36 +10:00
Angus Salkeld
988c1e259c
Fix splint warning
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 23:29:05 +10:00
Angus Salkeld
cceb4e2e5f
Avoid strcpy() use strlcpy() instead.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 22:31:57 +10:00
Angus Salkeld
95840eb3aa
Fix kqueue complile warnings
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 22:31:29 +10:00
Angus Salkeld
d92bfa2b0e
openbsd doesn't have EBADMSG
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 22:30:58 +10:00
Angus Salkeld
a55554efb1
LOG: change qb_vsprintf_serialize() into qb_vsnprintf_serialize()
...
This is to prevent overwriting the ringbuffer.
Also remove stpcpy() as it is not used anymore.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 21:40:40 +10:00
Angus Salkeld
10045dd561
Some missing pshared semaphore checks
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 12:26:47 +10:00
Angus Salkeld
873e467cf8
Cleanup the checks for pshared semaphores
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 10:22:56 +10:00
Angus Salkeld
fb76492880
RB: change the #error to ENOTSUP if no usable shared process sem
...
This is mainly on mac.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-28 21:30:43 +10:00
Angus Salkeld
b6839bacfe
LOOP-KQUEUE: fix reference before assignment.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-28 14:39:28 +10:00
Fabio M. Di Nitto
5e16bcd004
build: fix libqb.pc creation and make maintainer-clean
...
LIB_RT is unnecessary around. AC_CHECK_LIBS will do the right thing
similar for the other libs that are all exported via LIBS
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-08-27 15:07:36 +02:00
Angus Salkeld
248259f12b
LOG: Make sure the semaphores are initialized.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-27 19:16:04 +10:00
Angus Salkeld
50632154ed
Catch disconnected sockets on Solaris
...
It seems like poll() was not producing a POLLHUP
so we rely on qb_ipc_us_recv() returning -ENOTCONN.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-24 11:49:07 +10:00
Jeremy Fitzhardinge
4a1e24ee3e
Don't free rb->shared_hdr in qb_rb_create_from_file()
...
Since qb_rb_close() frees it by munmapping it.
2012-08-23 10:14:11 -07:00
Jeremy Fitzhardinge
069f4e3190
Check error return of qb_ipcs_uc_recv_and_auth()
...
If it fails, then &ugp isn't initialized.
2012-08-23 10:12:09 -07:00
Angus Salkeld
70c8df9a19
Work around debian not setting the arch path in splint.
...
So just adding both i386 and x86_64 to the path.
Ref: http://lists.gnu.org/archive/html/gpsd-dev/2012-05/msg00221.html
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-22 10:58:29 +10:00
David Vossel
d5b762e441
LOG: Invoke custom log filter function if tag changes
2012-07-19 17:18:46 -05:00
Jim Meyering
c60f5012ea
ipcs: avoid use-after-free for size-0 || disconnect-request
...
Hi,
Glancing through coverity-reported issues,
I saw that this one required attention:
From 70f1f689022321710405f16dc45b3df30c22bc59 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 18 Jul 2012 17:34:17 +0200
Subject: [PATCH] ipcs: avoid use-after-free for size-0 || disconnect-request
spotted by coverity:
http://libqb.org/html/0.14.1/coverity/1/265ipcs.c.html#error
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-19 08:19:22 +10:00
The Quarterback Library Release Team
5470bf5625
Bump the version to 0.14.1
...
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-07-17 22:03:31 +10:00
Angus Salkeld
e5be0396a7
RB: set the new read pointer after clearing the header.
...
This is to prevent a situation where a fast writer will
write their new chunk between setting the new read pointer
and clearing the header.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 21:18:47 +10:00
Angus Salkeld
3feb3b6b8f
RB: improve the debug print outs
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 20:45:29 +10:00
Angus Salkeld
b9a992a5d3
RB: be more explicit about the word alignment
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 19:37:52 +10:00
Angus Salkeld
15d0291a8a
RB: cleanup the macros for wrapping the index
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 12:38:22 +10:00
Angus Salkeld
6e1d9054c3
RB: use sem_getvalue as a tie breaker when read_pt == write_pt
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 12:38:22 +10:00
Angus Salkeld
bdc63cdf1a
RB: if read or peek don't get the message then re-post to the semaphore
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 12:38:22 +10:00
Angus Salkeld
deddaea86c
RB: convert the rb_peek() status into a recv like status.
...
peek returns 0 on no data, so convert that to -EAGAIN.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 12:22:31 +10:00
Angus Salkeld
121abe3dbe
RB: use internal reclaim function
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 12:22:26 +10:00
Angus Salkeld
3b31023d84
IPC: use calloc instead of malloc to fix valgrind warnings
...
This is to cleanup some valgrind warnings.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 12:22:17 +10:00
Angus Salkeld
740f9df7ac
Fix a valgrind error.
...
just use the receive buffer, as it will be big enough.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-14 22:29:25 +10:00
The Quarterback Library Release Team
1c2b77f005
Bump the version to 0.14.0
...
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-06-22 16:29:32 +10:00
Angus Salkeld
b9f8ec34df
LOG: fix threaded logging.
...
This has been broken for a year - yikes!
Thanks to Voznesensky Vladimir for spotting it.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-14 11:01:52 +10:00
Angus Salkeld
22569f51ba
Add user control of the permissions that are set on the shared mem files
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-13 08:21:09 +10:00
Andrew Beekhof
e70e7908f0
LOG: Restrict string trucation during serialization to when a precision is specified
2012-06-07 15:02:06 +10:00
Andrew Beekhof
bb2e307241
LOG: Gracefully fail when the caller exceeds QB_LOG_MAX_LEN
2012-06-07 14:41:03 +10:00
Andrew Beekhof
9b0bb4e80e
LOG: Observe field widths when serializing string arguments
2012-06-07 14:40:34 +10:00
Angus Salkeld
3369581066
RB: use the same mechanism in reclaim as read/peek to detect end-of-ring
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-07 12:02:32 +10:00
Angus Salkeld
9520fc4501
RB: fix wrong sem_flg IPC_NOWAIT option
...
The #ifdef was the wrong way around causing
the sem to return early with EAGAIN.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-06 16:22:58 +10:00
Angus Salkeld
194b93678f
Open shared mem file in /dev/shm only for linux
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-06 15:31:51 +10:00
Angus Salkeld
c0f52fb5c2
Don't use msg_flags on solaris (recvmsg).
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-06 15:29:10 +10:00
Angus Salkeld
73731f0643
IPC: if the server returns EAGAIN or ETIMEOUT the check the connection
...
Mainly useful for shm, as the ringbuffer doesn't know the state
of the connection.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-06 13:46:58 +10:00
Angus Salkeld
b52f2e37b3
LOG: make it possible to fsync() on each file log.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-05 12:07:35 +10:00
Angus Salkeld
460cc70a8b
IPC: make sure that the created callback happens before dispatches
...
This only happened on the socket ipc type.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-04 21:45:28 +10:00
Angus Salkeld
9956fe29ff
LOG: fix the printing of %p in the blackbox
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-04 14:54:39 +10:00
Angus Salkeld
1e81530332
IPC: On bsd's use the notifier for responses
...
The point of this is to catch connection failures
more reliably.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-01 11:12:44 +10:00
Angus Salkeld
44f61b23bb
IPC: interpret ECONNRESET and EPIPE as ENOTCONN
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-01 10:15:36 +10:00
Angus Salkeld
35a4421d23
cleanup some warnings
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-31 22:18:04 +10:00
Angus Salkeld
9f90b16d06
blackbox: fix %p formatting
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 23:16:49 +10:00