Commit Graph

1329 Commits

Author SHA1 Message Date
Chrissie Caulfield
d2fc58d8d7 Merge pull request #197 from kskmori/syslog-tests-rpm
build: do not install syslog_override for the RPM packaging
2016-03-08 09:16:03 +00:00
Keisuke MORI
ebcff547bc build: do not install syslog_override for the RPM packaging 2016-03-08 01:55:07 +00:00
Jan Pokorný
f5ed676fe9
build: be more restrictive about QB_HAVE_ATTRIBUTE_SECTION
That's because the code relies on (fairly unportable) treatment by the
linker, specifically ld linker from binutils suite:

    <https://sourceware.org/binutils/docs/ld/Orphan-Sections.html>

and without that in place, QB_HAVE_ATTRIBUTE_SECTION cannot be enabled
as the __{start,stop}_SECNAME extern references in qb/qblog.h will not
get resolved at the link time.
2016-03-04 15:42:22 +01:00
Jan Pokorný
9d696f5f5a
Low: further avoid magic in qblog.h by using named constants
Also advise to use these constants and obey this in the internal code.
2016-03-04 14:55:52 +01:00
Jan Pokorný
9b6783568a
defs: add wrappers over preprocessor operators 2016-03-04 14:54:08 +01:00
Jan Pokorný
c148444d20
Low: explain mysterious lines in a public header (qblog.h)
Also fix the previous inversion of the expression that in fact did not
use to check for anything (for "assert(1)" being a NOOP).
2016-03-04 14:51:57 +01:00
Chrissie Caulfield
043cebb29e Merge pull request #190 from jnpkrn/build-syslog-tests-followup
build: syslog tests follow-up
2016-03-01 15:34:11 +00:00
Jan Pokorný
3d6135967a
tests: refactor test case defs using versatile add_tcase macro
This reduces repeated code significantly, and allows for easier
supervision of what's being grouped to the suites + possibly what
timeouts apply.

Note that some artificial test case identifiers (in check_array.c,
check_log.c, check_loop.c, check_rb.c, check_utils.c) got changed
so they now follow 1:1 the test (function) name that is being run
for the case at hand without the "test_" prefix (strict convention).
Exception to this are test_ipc_disp_* tests in check_ipc.c that got,
conversely, changed to test_ipc_dispatch_* to follow the test case
identifiers.
2016-03-01 15:11:38 +01:00
Jan Pokorný
4239f4b833
build: enable syslog tests when configuring in spec
...hence make syslog tests executed in %check.
2016-03-01 14:37:31 +01:00
Jan Pokorný
c8fc62573f
build: fix tests/_syslog_override.h not being distributed
...in the tarball arising from "make dist".
2016-03-01 14:36:39 +01:00
Christine Caulfield
f439488261 travis: Add a normal 'make' to the checks
make check doesn't build the docs and so errors in that part of
the build system will not be checked without a normal 'make'.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-02-22 16:02:25 +00:00
Chrissie Caulfield
0aa67067bb Merge pull request #185 from jnpkrn/followup-fixes
Follow-up fixes
2016-02-22 14:09:20 +00:00
Jan Pokorný
e490932907
build: GCC < 4.6 does not support diagnostic push/pop pragmas
Better to get sort of a spurious warning then to possibly mess up
with a warnings safety net.

Reported by Chrissie (thanks).
2016-02-22 14:51:19 +01:00
Jan Pokorný
4df20fbb53
build: fix man3 pages not installed
Issue with original version of the patch spotted by Chrissie (thanks).
2016-02-22 14:50:37 +01:00
Chrissie Caulfield
91fd29f077 Merge pull request #179 from dpejesh/socket
socket improvements for freebsd
2016-02-22 10:40:19 +00:00
Chrissie Caulfield
21ca3b4fbf Merge pull request #184 from jnpkrn/maint-no_magic-build_manpages
Maintainance: no magic + better manpages building
2016-02-22 09:46:25 +00:00
Chrissie Caulfield
7b9b72e690 Merge pull request #181 from jnpkrn/log-target-slot-enum
log: enum qb_log_target_slot introduction + qblog.h cleanup
2016-02-22 09:45:32 +00:00
Jan Pokorný
792c34bf6b
build: header-based man pages: include also qbdefs.h+qbrb.h
No reason not to do that.  Situation with qbconfig.h is a bit more
complicated as this file gets generated from .in file and there is
currently no reliable inter-dir/makefile (siblings) targets
dependency tracking in place, AFAICT.
2016-02-18 19:04:48 +01:00
Jan Pokorný
cf1588c6ec
build: header-based man pages: dependent_headers - blacklist
IOW, make tracking of interfaces to document via man pages maintainable.
2016-02-18 18:56:54 +01:00
Jan Pokorný
0b04ed5e77
build: grab "dependent_headers" from respective Makefile.am
...with "echo path/*.h" fallback (equivalent of wildcard function) if
the new methods fails for some reason.
2016-02-18 18:33:14 +01:00
Jan Pokorný
cabe021d47
build: fix "dependant" typo 2016-02-18 18:28:03 +01:00
Jan Pokorný
c36a00929b
Low: no magic constants + gethostname usage sanity 2016-02-18 16:45:51 +01:00
Chrissie Caulfield
c242bada46 Merge pull request #177 from jnpkrn/changing-syslog-identifier-nicer
Changing syslog identifier + testing syslog, preferred edition
2016-02-18 15:32:33 +00:00
Chrissie Caulfield
c4c4ca8464 Merge pull request #180 from jnpkrn/example-simplelog-stdout
example: simplelog supports -o (for stdout sink)
2016-02-18 14:58:38 +00:00
Chrissie Caulfield
6137f654e3 Merge pull request #178 from jnpkrn/format-annotations
build: avoid too keen -Wmissing-format-attribute warning
2016-02-18 11:37:56 +00:00
Chrissie Caulfield
3b7b50dead Merge pull request #183 from jnpkrn/doc-fix-overview
Doc: fix overview
2016-02-18 11:14:50 +00:00
Jan Pokorný
7b10be7401
CI: restore travis notifications, IRC this time around
While quarterback [dash] devel [at] lists [dot] fedorahosted [dot] org,
original notification target and development ML seems long gone (without
archives preserved!), let's use #clusterlabs-dev at freenode IRC
network.  This is in-line with the purpose of the channel and it's what
clufter, crmsh and hawk seem to be currently using.
2016-02-18 12:06:28 +01:00
Jan Pokorný
fa73c21ae4
CI: enable recently added syslog-tests in .travis.yml 2016-02-18 11:32:55 +01:00
Jan Pokorný
0fc2757546
CI: .travis.yml cosmetics 2016-02-18 11:32:40 +01:00
Jan Pokorný
642f74de61
Feature: allow changing the identifier for syslog (+tests)
Original "qb_log_ctl" interface had to be extended for passing read-only
strings (new parameter), resulting in new "qb_log_ctl2" function, which
is what qb_log_ctl calls into with the new parameter set to NULL.
This ensures backward compatibility.

A new QB_LOG_CONF_IDENT configuration directive for the mentioned
interface is added with a goal to set new internal identifier
that is, notably, used for syslog sink.  This allows for switching
the identification without a need to reinitialize logging subsystem,
akin to changing target logging facility.

Also a brand new concept of testing syslog sink in particular is
introduced (finally).  During initial trial&error stage, it used
LD_PRELOAD hack but it seems that libtool is sophisticated enough
that no such extra intervention is needed and the desired symbol
resolution Just Works (tm).  However, the technique is highly
non-portable (there is even a warning about that from libtool,
which is partially on purpose as the _syslog_override.so should
rather be explicit it is by no mean a regular library) and hence
the syslog tests have to be enabled with explicit

    ./configure --enable-syslog-tests

rather than possibly break on untested platforms (far too many).
The concept can be extended upon, but initially, just the new
feature is being tested.

Post-review: thanks Chrissie for a suggestion how to deal with
extract-arg-and-forget in a less intrusive way (no defines).
2016-02-18 11:30:14 +01:00
Jan Pokorný
837108b02a
qblog.h: fix typos and make stylistic enhancements 2016-02-16 18:10:10 +01:00
Jan Pokorný
78d5d1686a
qblog.h: unify descriptions before the code examples
- use semicolons at the end of the description
- use commas when there can be an issue with parsing a long sentence
  (and wrap such text at 79 characters if applicable)
2016-02-16 18:08:46 +01:00
Jan Pokorný
7a290093d0
log: convert few more instances to use enum qb_log_target_slot 2016-02-16 18:08:13 +01:00
Jan Pokorný
2198893c3e
log: refactor static target slots state initialization
It doesn't matter that also syslog is disabled first, as it will get
enabled few lines later on (uniformity + simplicity > optimization +
complexity).
2016-02-16 18:07:45 +01:00
Jan Pokorný
807c7dc34a
log: better (fixed) documentation for funcs returning "slot" index
Also add missing "stdout" to the enumerations of the static ones.
2016-02-16 18:06:52 +01:00
Jan Pokorný
fdbb80a87b
doc: IPC overview: fix typos 2016-02-16 17:49:01 +01:00
Jan Pokorný
3ef3ae434f
doc: main overview: fix style + reword per spec file 2016-02-16 17:48:35 +01:00
Jan Pokorný
4ccca4bda9
log: convert log target defined values into enum values
Also use the new enum qb_log_target_slot type in for-loops together
with a proper substitute for the literal "0" initializer.

There could be more places that might be type-substituted for this enum
(and hence possibly catch more of an incorrect usage if the compiler
or checker has some notion of enum type narrowing), but leave it as
a possible enhancement for now.
2016-02-16 14:49:02 +01:00
Jan Pokorný
e74214b79b
log: defined value as an index-pointer after static slots
Amongst other uses, this allows for better (fixed) documentation
regarding how many additional logging targets the user can define.
2016-02-16 14:48:06 +01:00
Jan Pokorný
6e6791113f
example: simplelog supports -o (for stdout sink) 2016-02-15 16:52:11 +01:00
David Shane Holden
33794cce5a ipc: return -errno when getsockopt/setsockopt fail 2016-02-14 16:44:17 -05:00
David Shane Holden
4978104ae4 ipc: set socket buffer size used by ipcs service 2016-02-14 16:29:11 -05:00
David Shane Holden
e788d618ee ipc: set socket receive buffer
Set the sockets receive buffer size to match the send buffer.  On
FreeBSD without this calls to sendto() will result in an ENOBUFS error
if the message is larger than net.local.dgram.recvspace sysctl.
2016-02-14 06:31:45 -05:00
Jan Pokorný
4f6c235470
build: avoid too keen -Wmissing-format-attribute warning
Grouped with pre-existing -Wsuggest-attribute=format treatment.
2016-02-12 23:33:13 +01:00
Chrissie Caulfield
242a07ebc2 Merge pull request #175 from jnpkrn/format-annotations
Format annotations
2016-02-04 09:16:55 +00:00
Chrissie Caulfield
386a6e9fdd Merge pull request #174 from jnpkrn/spec-cleanup
Spec cleanup
2016-02-04 09:16:31 +00:00
Jan Pokorný
4fd4e5e71b
spec cleanup: drop redundant %{buildroot} cleaning
References:
http://pkgs.fedoraproject.org/cgit/rpms/redhat-rpm-config.git/commit/?id=159a65f
(~2010)
2016-02-03 15:44:40 +01:00
Jan Pokorný
4037a3684d
spec cleanup: summary should not end with a dot
References:
https://fedoraproject.org/wiki/Common_Rpmlint_issues#summary-ended-with-dot
https://en.opensuse.org/openSUSE:Specfile_guidelines#Summary

+ it's an internal inconsistency with Summary for -devel package
2016-02-03 15:44:04 +01:00
Jan Pokorný
736e2c8153
includes: format __attribute__ func. annotations in qblog.h
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2016-02-03 15:40:36 +01:00
Jan Pokorný
ea35cfaa61
build: avoid too keen -Wsuggest-attribute=format warning
With gcc 5.3.1 20151207:
> log.c: In function 'cs_format':
> log.c:182:2: warning: function might be possible candidate for
>              'gnu_printf' format attribute [-Wsuggest-attribute=format]
>   len = vsnprintf(str, QB_LOG_MAX_LEN, cs->format, ap_copy);
>   ^

We certainly don't want to disable that warning globally so make use of
diagnostic pragmas for GCC instead in one instance that we cannot
annotate properly.

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2016-02-03 15:40:11 +01:00