Commit Graph

770 Commits

Author SHA1 Message Date
Angus Salkeld
79059bcae3 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>
2012-10-22 11:15:05 +11:00
Angus Salkeld
bcba4a2983 Fix a crash in ptrie if you iterate over the map in the deleted notifier.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-09-12 10:39:17 +10:00
Angus Salkeld
aedcb97690 Make sure atomic's are initialized (for non-gcc atomic).
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-09-11 14:42:04 +10:00
The Quarterback Library Release Team
d54e8b1e8c Fix "make distcheck"
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-09-10 11:09:28 +10:00
The Quarterback Library Release Team
74b7c6e990 Bump the version to 0.14.2
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-09-10 10:58:14 +10:00
Виноградов Василий
f44efc4529 Get libqb building on cygwin.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-09-07 09:14:07 +10:00
Angus Salkeld
3fcdb5db77 Merge pull request #42 from jsgf/master
Three fixes for ipc_us.c
2012-09-05 18:36:53 -07:00
Jeremy Fitzhardinge
20a7075862 ipc_us: slightly more robust cmsg handling
Cope with multiple cmsg structures in the received msg.
2012-09-05 17:57:23 -07:00
Jeremy Fitzhardinge
6d75ccba6f ipc_us: on Linux, set SO_PASSCRED on the sending socket too
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".)
2012-09-05 17:51:49 -07:00
Jeremy Fitzhardinge
b79f8ceb1e ipc_us: clear request unused fields
Clear unused request fields and padding so that valgrind doesn't complain
about undefined data being sent over the socket.
2012-09-05 17:01:55 -07:00
Andrew Beekhof
951c9826f8 TEST: Include writing and reading the blackbox in the log_long_msg test 2012-09-05 19:34:56 +10:00
Angus Salkeld
9d33e1f40d LOG: fix qb_vsnprintf_deserialize()
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>
2012-09-05 18:35:19 +10:00
Angus Salkeld
5a0bb8542b Merge pull request #41 from jsgf/master
Fix some 64-bit big-endian issues
2012-09-01 04:49:00 -07:00
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
f6f50a9d38 Define unix path max for openbsd
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-31 13:55:29 +10:00
Angus Salkeld
939c1fa7d4 Only turn on ipc_needs_response_ack=yes for solaris
Hopefully I can kill this option.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-31 13:43:04 +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
92b3b415b5 openbsd requires netinet/in.h before arpa/inet.h
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 22:40:38 +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
924ad01058 openbsd has a different UNIX_PATH_MAX
103 other bsd's are 108

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 22:30:24 +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
8820724f59 TEST: increase timeout to 6 secs as the recv timeout is 5 secs
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 13:56:03 +10:00
Angus Salkeld
ace73af366 TEST: get the logic right - grrr.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 12:33:07 +10:00
Angus Salkeld
f9a272870d Turn off attribute_section on netbsd
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 12:27:20 +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
83062001f7 Add a config check for pthread_mutexattr_setpshared
Not available on netbsd

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 10:22:00 +10:00
Angus Salkeld
43b49dfda9 Remove uses of timersub and use qb_util_stopwatch
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-28 22:05:09 +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
Fabio M. Di Nitto
7fe0d50b14 build: remove bashism in cc support check
this is required for all systems that don't use bash for /bin/sh

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-24 22:01:31 +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
Angus Salkeld
3ce3a8984d Merge pull request #40 from jsgf/master
Merge Jeremy's clang bugfixes.
2012-08-23 15:35:32 -07: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
Andrew Beekhof
80d33e80a6 Fix removal of automatically installed doc files when building rpms 2012-08-23 10:22:18 +10:00
Angus Salkeld
8857544992 Add the mailing list to the travis email notifications.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-22 11:11:19 +10: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
Angus Salkeld
1e497d273c Remove color-tests and parallel-tests automake options.
This is just too painful for buildsystems like koji and travis.
You can't get access to the detailed output (error logs) that
otherwise be printed to screen.
I can't find a way to disable them on the command line (that
would be the best solution).

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-22 10:27:38 +10:00
Angus Salkeld
fef547a16e Add travis continuous integration config
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-22 10:11:16 +10:00
Angus Salkeld
11b20e19be Merge pull request #39 from davidvossel/log_tag_fix
LOG: Invoke custom log filter function if tag changes
2012-07-19 16:20:09 -07:00
David Vossel
d5b762e441 LOG: Invoke custom log filter function if tag changes 2012-07-19 17:18:46 -05:00
Jim Meyering
2ada241eee tests/rbwriter: don't ignore write failure
Here's another fix.
In adjusting the printf, I added a cast and switched to %5ld.
I would have preferred to use %5jd as the printf format (i.e., then no
cast is needed), but saw no other uses of the "j" directive, so perhaps
you do not yet depend on printf with such support.

From 6d5d3af35d1f6851537f7af8996d1106c1ebe435 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 18 Jul 2012 17:54:38 +0200
Subject: [PATCH] tests/rbwriter: don't ignore write failure

Spotted by coverity:
This less-than-zero comparison of an unsigned value is never true.
"res < 0U".
http://libqb.org/html/0.14.1/coverity/1/7rbwriter.c.html#error

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-19 08:19:22 +10:00