b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
da0a9a330537cb77bd43c3522940f9e6850d939e |
|
20-Jan-2016 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal-gatewayd: fix offset
I was checking something when writing the patch and
committed this by mistake. |
b3b0c23a56a2506a0d181af2f1775e3a98966c49 |
|
18-Jan-2016 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal-remote: update to 64bit µhttp api, provide fallback
64 bit offset is now accepted, which is nice. The old function is
deprecated, and generates a compile time warning when used. We only
use an offset of 0, so we really don't care. Adapt to use the new
function, but fall back to the old one on older versions. |
ce7229a224228bb996f50181d09757406891e3d6 |
|
18-Jan-2016 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal-remote: fix warning about deprecated µhttpd macro
src/journal-remote/journal-remote.c:590:13: warning: Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use MHD_HTTP_NOT_ACCEPTABLE
return mhd_respond(connection, MHD_HTTP_METHOD_NOT_ACCEPTABLE,
^
The new define was added in 0.9.38. Instead of requiring the new
libmicrohttpd version, provide the fallback, it is trivial. |
11bb5147b31c737e447166ba75d79f622ca120ca |
|
14-Dec-2015 |
Dan Dedrick <ddedrick@lexmark.com> |
journal-gatewayd: timeout journal wait to allow thread cleanup
When a client connects with follow=1 and then disconnects we can get
stuck in sd_journal_wait indefinitely if no journal messages are logged.
Every time a client does this another thread is allocated and these
continue to stack until either a journal message is logged or we run out
of mapping to put a stack in.
By adding a timeout if we don't see any journal messages in that timeout
we will simply pop back out to microhttpd which will sanity check the
connection for us and if it is still connected pop us back into the wait
for more journal messages. |
4afd3348c7506dd1d36305b7bcb9feb8952b9d6b |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy
GLIB has recently started to officially support the gcc cleanup
attribute in its public API, hence let's do the same for our APIs.
With this patch we'll define an xyz_unrefp() call for each public
xyz_unref() call, to make it easy to use inside a
__attribute__((cleanup())) expression. Then, all code is ported over to
make use of this.
The new calls are also documented in the man pages, with examples how to
use them (well, I only added docs where the _unref() call itself already
had docs, and the examples, only cover sd_bus_unrefp() and
sd_event_unrefp()).
This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we
tend to call our destructors these days.
Note that this defines no public macro that wraps gcc's attribute and
makes it easier to use. While I think it's our duty in the library to
make our stuff easy to use, I figure it's not our duty to make gcc's own
features easy to use on its own. Most likely, client code which wants to
make use of this should define its own:
#define _cleanup_(function) __attribute__((cleanup(function)))
Or similar, to make the gcc feature easier to use.
Making this logic public has the benefit that we can remove three header
files whose only purpose was to define these functions internally.
See #2008. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
6bedfcbb2970e06a4d3280c8fb62083d252ede73 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split string parsing related calls from util.[ch] into parse-util.[ch] |
3ffd4af22052963e7a29431721ee204e634bea75 |
|
25-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over. |
ef08ced6b44d4f56477a6798e56ba5c5c9e0023f |
|
30-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
journal: make sure to set MHD_USE_PIPE_FOR_SHUTDOWN for libmicrohttpd servers
This makes sure libmicrohttpd won't call shutdown() on our listening
sockets, which make sure socket activation and re-activation will work
cleanly.
See:
https://github.com/systemd/systemd/pull/1286
https://lists.gnu.org/archive/html/libmicrohttpd/2015-09/msg00014.html
Fixes #1286 |
3f6fd1ba65f962702753c4ad284b588e59689a23 |
|
29-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
util: introduce common version() implementation and use it everywhere
This also allows us to drop build.h from a ton of files, hence do so.
Since we touched the #includes of those files, let's order them properly
according to CODING_STYLE. |
74ca738f6a01fb5fc19c5c3899f5cb1fdc1d7f68 |
|
09-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
util: introduce safe_fclose() and port everything over to it
Adds a coccinelle script to port things over automatically. |
ece174c5439021e32ebcc858842de9586072c006 |
|
09-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: drop {} from one-line if blocks
Patch via coccinelle. |
a1e58e8ee1c84b633d6d6d651d5328d4dd4eba5b |
|
09-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: use coccinelle to patch a lot of code to use mfree()
This replaces this:
free(p);
p = NULL;
by this:
p = mfree(p);
Change generated using coccinelle. Semantic patch is added to the
sources. |
3e044c492e3ebe64f4e3175c94f9db8a62557b82 |
|
17-Aug-2015 |
Markus Elfring <elfring@users.sourceforge.net> |
Bug #944: Deletion of unnecessary checks before a few calls of systemd functions
The following functions return immediately if a null pointer was passed.
* calendar_spec_free
* link_address_free
* manager_free
* sd_bus_unref
* sd_journal_close
* udev_monitor_unref
* udev_unref
It is therefore not needed that a function caller repeats a corresponding check.
This issue was fixed by using the software Coccinelle 1.0.1. |
ae691c1d9382995ea7e28317f5c37023229c27ee |
|
06-Aug-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
hostname-util: get rid of unused parameter of hostname_cleanup()
All users are now setting lowercase=false. |
9e19c04f3a4e03e37dc89b63c1ae9b0a7c611810 |
|
07-Jul-2015 |
Daniel Mack <daniel@zonque.org> |
journal-gatewayd: fix tmpfile logic
"rw" is not a valid mode string for f*open(). This got broken in
cc02a7b33049 ("journal-gatewayd: factor out opening of temp
file"). |
958b66ea16deddd794b3a52643bd44633e165ead |
|
18-May-2015 |
Lennart Poettering <lennart@poettering.net> |
util: split all hostname related calls into hostname-util.c |
e51728b0475f68d0f84c1dca8a02c17c9f5a6a29 |
|
13-Apr-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal-gatewayd: use (void) to silence coverity
CID #996297. |
a7f7d1bde43fc825c49afea3f946f5b4b3d563e0 |
|
27-Mar-2015 |
Harald Hoyer <harald@redhat.com> |
fix gcc warnings about uninitialized variables
like:
src/shared/install.c: In function ‘unit_file_lookup_state’:
src/shared/install.c:1861:16: warning: ‘r’ may be used uninitialized in
this function [-Wmaybe-uninitialized]
return r < 0 ? r : state;
^
src/shared/install.c:1796:13: note: ‘r’ was declared here
int r;
^ |
cc02a7b3304975e39ad5863983b16ef149b7f9e9 |
|
15-Mar-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal-gatewayd: factor out opening of temp file
Also use our own mkostemp wrapper, which tries to use O_TMPFILE. |
d357562c48ac71e2197ea63bc57671a29ba12cf6 |
|
14-Mar-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
µhttp-util: setup gnutls logs in one function |
2cf4172a71860c6e44edd27a3b68047ae062d7fc |
|
05-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
journal: install sigbus handler for journal tools too
This makes them robust regarding truncation. Ideally, we'd export this
as an API, but given how messy SIGBUS handling is, and the uncertain
ownership logic of signal handlers we should not do this (unless libc
one day invents a scheme how to sanely install SIGBUS handlers for
specific memory areas only). However, for now we can still make all our
own tools robust.
Note that external tools will only have read-access to the journal
anyway, where SIGBUS is much more unlikely, given that only writes are
subject to disk full problems. |
56f64d95763a799ba4475daf44d8e9f72a1bd474 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful
value, so we might as well use log_*_errno to have ERRNO= logged.
Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/'
Plus some whitespace, linewrap, and indent adjustments. |
23bbb0de4e3f85d9704a5c12a5afa2dfa0159e41 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: more log_*_errno + return simplifications |
da927ba997d68401563b927f92e6e40e021a8e5c |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values. |
0a1beeb64207eaa88ab9236787b1cbc2f704ae14 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'
Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno(). |
601185b43da638b1c74153deae01dbd518680889 |
|
04-Aug-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Unify parse_argv style
getopt is usually good at printing out a nice error message when
commandline options are invalid. It distinguishes between an unknown
option and a known option with a missing arg. It is better to let it
do its job and not use opterr=0 unless we actually want to suppress
messages. So remove opterr=0 in the few places where it wasn't really
useful.
When an error in options is encountered, we should not print a lengthy
help() and overwhelm the user, when we know precisely what is wrong
with the commandline. In addition, since help() prints to stdout, it
should not be used except when requested with -h or --help.
Also, simplify things here and there. |
8201af08fa09c2bd0f005fbe262f27e2c5bd2d86 |
|
16-Jul-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal-remote: allow splitting incoming logs by source host
Previously existing scheme where the file name would be based on
the source was just too ugly and unpredicatable. Now there are
only two options:
1. just one file (until rotation),
2. one file per source host, using the hostname as filename part.
For the cases where the source is specified by the user, only
option one is allowed, and the full of the file must be specified. |
1e4e7b71e1938daa9b2b9718a9f54c69017a9ef5 |
|
16-Jul-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Move network-related journal programs to src/journal-remote/
Directory src/journal has become one of the largest directories,
and since systemd-journal-gatewayd, systemd-journal-remote, and
forthcoming systemd-journal-upload are all closely related, create
a separate directory for them. |