Systemd/src/journal
Lennart Poettering 0d53667334 tree-wide: use __fsetlocking() instead of fxyz_unlocked()
Let's replace usage of fputc_unlocked() and friends by __fsetlocking(f,
FSETLOCKING_BYCALLER). This turns off locking for the entire FILE*,
instead of doing individual per-call decision whether to use normal
calls or _unlocked() calls.

This has various benefits:

1. It's easier to read and easier not to forget

2. It's more comprehensive, as fprintf() and friends are covered too
   (as these functions have no _unlocked() counterpart)

3. Philosophically, it's a bit more correct, because it's more a
   property of the file handle really whether we ever pass it on to another
   thread, not of the operations we then apply to it.

This patch reworks all pieces of codes that so far used fxyz_unlocked()
calls to use __fsetlocking() instead. It also reworks all places that
use open_memstream(), i.e. use stdio FILE* for string manipulations.

Note that this in some way a revert of 4b61c87511.
2017-12-14 10:42:25 +01:00
..
audit-type.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
audit-type.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
audit_type-to-name.awk meson: also indent scripts with 8 spaces 2017-04-25 08:49:16 -04:00
cat.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
catalog.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
catalog.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
compress.c journal: avoid undefined behaviour in float division by 0.0 2017-11-28 21:34:50 +01:00
compress.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
fsprg.c Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
fsprg.h Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
generate-audit_type-list.sh meson: also indent scripts with 8 spaces 2017-04-25 08:49:16 -04:00
journal-authenticate.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journal-authenticate.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journal-def.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journal-file.c journal: use new helpers with journal_file_close 2017-11-28 21:34:50 +01:00
journal-file.h journal: use new helpers with journal_file_close 2017-11-28 21:34:50 +01:00
journal-internal.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journal-qrcode.c tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
journal-qrcode.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journal-send.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journal-vacuum.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journal-vacuum.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journal-verify.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journal-verify.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journalctl.c journalctl: add --output-fields= to --help text (#7443) 2017-11-24 10:04:14 +01:00
journald-audit.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald-audit.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald-console.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald-console.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald-context.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald-context.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald-gperf.gperf tree-wide: adjust fall through comments so that gcc is happy 2017-11-20 13:06:25 -08:00
journald-kmsg.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald-kmsg.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald-native.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald-native.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald-rate-limit.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald-rate-limit.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald-server.c journal,coredump: do not do ACL magic for "nobody" user either 2017-12-06 13:40:50 +01:00
journald-server.h journald: correct field counts 2017-11-29 11:37:21 +01:00
journald-stream.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald-stream.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald-syslog.c tree-wide: adjust fall through comments so that gcc is happy 2017-11-20 13:06:25 -08:00
journald-syslog.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald-wall.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald-wall.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journald.conf journald: make maximum size of stream log lines configurable and bump it to 48K (#6838) 2017-09-22 10:22:24 +02:00
lookup3.c journal/lookup3: silence gcc 7 implicit-fallthrough warning 2017-01-31 14:04:55 -05:00
lookup3.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
meson.build Add license headers and SPDX identifiers to meson.build files 2017-11-19 19:08:15 +01:00
mmap-cache.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
mmap-cache.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
sd-journal.c journal: use new helpers with journal_file_close 2017-11-28 21:34:50 +01:00
test-audit-type.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-catalog.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-compress-benchmark.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-compress.c test: handle gracefully if decompressor tools are not installed (#7455) 2017-11-24 14:08:51 +01:00
test-journal-enum.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-journal-flush.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-journal-init.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-journal-interleaving.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-journal-match.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-journal-send.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-journal-stream.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-journal-syslog.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-journal-verify.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-journal.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-mmap-cache.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00