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. |
4850d39ab72e7cb00a6e9c9aa4745c997674efa6 |
|
26-Jan-2016 |
Lennart Poettering <lennart@poettering.net> |
journald: add a couple of static asserts checking logging constants
Whenever we include a log level or facility in a journal string field, make sure the compiler checks for us that that's
actually the right thing to do. |
4941e4aca907f26bf74aa9efe1c70ccad1d10a82 |
|
03-Dec-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal: silently skip failing large messages if journald is missing
We treated -ENOENT errors with silent failure, for small messages.
Do the same for large messages. |
726f4c4738e74c5b2d1f9b4eede3a7f753440e8d |
|
03-Dec-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal: unbreak sd_journal_sendv
Borked since
commit 3ee897d6c2401effbc82f5eef35fce405781d6c8
Author: Lennart Poettering <lennart@poettering.net>
Date: Wed Sep 23 01:00:04 2015 +0200
tree-wide: port more code to use send_one_fd() and receive_one_fd()
because here our fd is not connected and we need to specify
the address. |
9a7800af088cc013573310504ae76e325d44d4b4 |
|
03-Dec-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal: addition and multiplication do not commute |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
15a5e95075a7f6007dd97b2a165c8ed16fe683df |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out printf() helpers to stdio-util.h |
0d39fa9c69b97a2ceb156053deef69c0866c2b97 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move more file I/O related calls into fileio.[ch] |
c004493cdefc1f43a3956ca529e8070f8d70be56 |
|
26-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out IO related calls to io-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. |
07630cea1f3a845c09309f197ac7c4f11edd3b62 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.
This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.
Also touches a few unrelated include files. |
3ee897d6c2401effbc82f5eef35fce405781d6c8 |
|
29-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: port more code to use send_one_fd() and receive_one_fd()
Also, make it slightly more powerful, by accepting a flags argument, and
make it safe for handling if more than one cmsg attribute happens to be
attached. |
5ffa8c818120e35c89becd938d160235c069dd12 |
|
01-Feb-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Add a snprinf wrapper which checks that the buffer was big enough
If we scale our buffer to be wide enough for the format string, we
should expect that the calculation was correct.
char_array_0() invocations are removed, since snprintf nul-terminates
the output in any case.
A similar wrapper is used for strftime calls, but only in timedatectl.c. |
1fa2f38f0f011010bf57522b42fcc168856a7003 |
|
22-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Assorted format fixes
Types used for pids and uids in various interfaces are unpredictable.
Too bad. |
553acb7b6b8d4f16a4747b1f978e8b7888fbfb2c |
|
10-Dec-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
treewide: sanitize loop_write
loop_write() didn't follow the usual systemd rules and returned status
partially in errno and required extensive checks from callers. Some of
the callers dealt with this properly, but many did not, treating
partial writes as successful. Simplify things by conforming to usual rules. |
a09abc4ae0bdc0200324eaa0416f23ff2170ec4e |
|
30-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
memfd: rename memfd.h to memfd-util.h to avoid any confusion with any libc provided headers |
73843b52585d42cc1a970a1c664818ece6942e9e |
|
30-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
memfd: always use our internal utility functions where we have them |
c79e98eadd3056a36a662699fa650db5b1bca0c3 |
|
30-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
journal: when sending huge log messages prefer memfds over temporary files in /dev/shm
Previously when a log message grew beyond the maximum AF_UNIX/SOCK_DGRAM
datagram limit we'd send an fd to a deleted file in /dev/shm instead.
Because the sender could still modify the file after delivery we had to
immediately copy the data on the receiving side.
With memfds we can optimize this logic, and also remove the dependency
on /dev/shm: simply send a sealed memfd around, and if we detect the
seal memory map the fd and use it directly. |
61c024b328d5493a334242a4d01ba923582093fa |
|
19-Jun-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal-send.c: use automatic cleanup |
03e334a1c7dc8c20c38902aa039440763acc9b17 |
|
18-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
util: replace close_nointr_nofail() by a more useful safe_close()
safe_close() automatically becomes a NOP when a negative fd is passed,
and returns -1 unconditionally. This makes it easy to write lines like
this:
fd = safe_close(fd);
Which will close an fd if it is open, and reset the fd variable
correctly.
By making use of this new scheme we can drop a > 200 lines of code that
was required to test for non-negative fds or to reset the closed fd
variable afterwards. |
87b0284327e34a4b96c22085fa2cdb3219294991 |
|
29-Jan-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Get rid of write_safe
Current glibc implementation is safe. Kernel does this atomically,
and write is actually implemented through writev. So if write is
async-signal-safe, than writev pretty much must be too. |
65b3903ff576488eaabb51d3c4fbf9c73d867d7c |
|
28-Jan-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal: guarantee async-signal-safety in sd_journald_sendv
signal(7) provides a list of functions which may be called from a
signal handler. Other functions, which only call those functions and
don't access global memory and are reentrant are also safe.
sd_j_sendv was mostly OK, but would call mkostemp and writev in a
fallback path, which are unsafe.
Being able to call sd_j_sendv in a async-signal-safe way is important
because it allows it be used in signal handlers.
Safety is achieved by replacing mkostemp with open(O_TMPFILE) and an
open-coded writev replacement which uses write. Unfortunately,
O_TMPFILE is only available on kernels >= 3.11. When O_TMPFILE is
unavailable, an open-coded mkostemp is used.
https://bugzilla.gnome.org/show_bug.cgi?id=722889 |
8e33886ec582336564ae11b80023abe93d7599c0 |
|
28-Jan-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Replace mkostemp+unlink with open(O_TMPFILE)
This will only work on Linux >= 3.11, and probably not on all
filesystems. Fallback code is provided. |
6c045c0b4c49c88a1d3b9360c05efa5084796d2d |
|
03-Dec-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal: fail silently in sd_j_sendv() if journal is unavailable
"syslog(3) and sd_journal_print() may largely be used interchangeably
functionality-wise" according to sd_journal_print(3). This socket
should be always available except in rare circumstatances, and we
don't random applications to fail on logging, so let's do what syslog
did. The alternative of forcing all callers to do error handling for
this rare case doesn't really have any benefits, since if they can't
log there isn't much they can do anyway.
https://bugzilla.redhat.com/show_bug.cgi?id=1023041 |
1ae464e09376853c52075ec4d8a6bfc4b4036d0c |
|
02-Dec-2013 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
Use assert_return in more of the public API |
44b601bc79e46722bc0f0862ee0ce34a2284ef11 |
|
16-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
macro: clean up usage of gcc attributes
Always use our own macros, and name all our own macros the same style. |
2a0e0692565f0435657c93498e09cbb2d3517152 |
|
22-Aug-2013 |
Shawn Landden <shawnlandden@gmail.com> |
remove hasprefix(), use startswith() |
fd59d9f29838c3888168554c774003e7ad6d33b0 |
|
21-Jun-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Add hasprefix macro to check prefixes of fixed length |
6e5abe1564070a760196b97031eca9cf5e95e8a2 |
|
14-Jun-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal: use initialization instead of zeroing |
44a6b1b68029833893f6e9cee35aa27a974038f6 |
|
03-May-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Add __attribute__((const, pure, format)) in various places
I'm assuming that it's fine if a _const_ or _pure_ function
calls assert. It is assumed that the assert won't trigger,
and even if it does, it can only trigger on the first call
with a given set of parameters, and we don't care if the
compiler moves the order of calls. |
5c0aa72a4999bdcf03fe93ed5c8213c2b4c681f0 |
|
02-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
util: add a bit of syntactic sugar for saving/restoring errno |
29abad107f8610e73b2fc091216040b579c75453 |
|
25-Nov-2012 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal: fix warning about pointer arithmetic
../src/journal/journal-send.c: In function 'sd_journal_sendv':
../src/journal/journal-send.c:250:73: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith] |
ee55db41442ad8055f5a84a339b1e0e22bc037c4 |
|
20-Nov-2012 |
Lennart Poettering <lennart@poettering.net> |
journal-send: always send SYSLOG_IDENTIFIER, if we have it
https://bugzilla.redhat.com/show_bug.cgi?id=872193 |
3ed08c446cfaaae2b234fdfeb0c34ab6b4748c3e |
|
20-Nov-2012 |
Lennart Poettering <lennart@poettering.net> |
journal-send: unify a bit of code |
07c289875fd46331a430c43e8991d3c7407cb703 |
|
03-Oct-2012 |
Lennart Poettering <lennart@poettering.net> |
journal-send: simplification |
72f1d5a2880d103dc1c1746f5c02e192e054705e |
|
24-Sep-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: also use new VA_FORMAT_ADVANCE() macro in sd_journal_send() |
a6e87e90ede66815989ba2db92a07102a69906fe |
|
06-Sep-2012 |
Lennart Poettering <lennart@poettering.net> |
journalctl: rework JSON output mode
This splits the JSON output mode into different modes: json and
json-pretty. The former printing one entry per line, the latter showing
JSON objects nicely indented and in multiple lines to make it easier to
read for humans. |
18c7ed186be28800a2eeb37ad31c9c44480d3d9c |
|
01-Aug-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: add sd_journal_perror() to API |
8b38f3cc3eb73adf9536cb73d0f319e60d42ea0c |
|
22-Jun-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: fix sd_journal_stream_fd() |
25d042e81516246b1ebf706a57c47ac19abb0b8a |
|
12-Apr-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: fix missing variable initialization |
5430f7f2bc7330f3088b894166bf3524a067e3d8 |
|
12-Apr-2012 |
Lennart Poettering <lennart@poettering.net> |
relicense to LGPLv2.1 (with exceptions)
We finally got the OK from all contributors with non-trivial commits to
relicense systemd from GPL2+ to LGPL2.1+.
Some udev bits continue to be GPL2+ for now, but we are looking into
relicensing them too, to allow free copy/paste of all code within
systemd.
The bits that used to be MIT continue to be MIT.
The big benefit of the relicensing is that closed source code may now
link against libsystemd-login.so and friends. |
b070e7f3c9ed680c821bd89d42506695f2438506 |
|
02-Apr-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: implicitly add code location to all messages logged with the native interface
This logic can be turned off by defining SD_JOURNAL_SUPPRESS_LOCATION
before including sd-journal.h.
This also saves/restores errno in all logging functions, in order to be
useful as logging calls without side-effects.
This also adds a couple of __unlikely__ around the early checks in the
logging calls, in order to minimize the runtime impact. |
bb99a35a873c35e80b0b47fe045081022660374d |
|
27-Jan-2012 |
Lennart Poettering <lennart@poettering.net> |
log: increase socket buffers for logging by default |
9058851be7821edac08c1fa7ecafe5cba9ab9022 |
|
18-Jan-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: when sending journal data via file, place it in /dev/shm, to allow early boot operation, even if it sucks |
0dad12c190b7493955cd60d2a1625199b1709f69 |
|
14-Jan-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: if the data to be sent is larger than the maximum datagram size resort to passing a temporary fd over native protocol |
5ba081b0fb02380cee4c2ff5bc7e05f869eb8415 |
|
12-Jan-2012 |
Lennart Poettering <lennart@poettering.net> |
log: make internal log api log directly to the journal |
4cd9a9d9ecf3a8835e21930f3215a5f5b74144be |
|
05-Jan-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: rename syslog tag to identifier since that's what we call it on the server side. |
86b9b8e70d54e79db3ff4f67bbd5280ecfc82537 |
|
05-Jan-2012 |
Lennart Poettering <lennart@poettering.net> |
sd-journal: close reading side of sd_journal_stream_fd() file descriptors |
259d2e762041d8d50c2a17bfea90b1a96f6b880b |
|
05-Jan-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: move sockets into their own subdir |
224f2ee221e77c326d1d7761abb6e812432b2163 |
|
05-Jan-2012 |
Lennart Poettering <lennart@poettering.net> |
journald: add configuration file options to forward all logged data to kmsg, console, syslog |
a5344d2c3b0f14e954ce1c0ef905c5b44bc5bf0a |
|
03-Jan-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: add _public_ to all sd-journal calls, and add parameter checks |
fe6521272ba203ec8f0d5a94f0729960b3f90525 |
|
23-Dec-2011 |
Lennart Poettering <lennart@poettering.net> |
journal: implement stdout transport |
d0bbc21caa6e68693a47db60c93e99422bf2a858 |
|
17-Dec-2011 |
Lennart Poettering <lennart@poettering.net> |
journal: introduce mandatory sd_journal_printf() priority parameter |
7f3e62571a63ac90de6ac5eefeeb8d3e9aa6f49e |
|
17-Dec-2011 |
Lennart Poettering <lennart@poettering.net> |
journal: add native protocol to journald, and client side API to send journal messages |