Systemd/src
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
..
ac-power Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
activate Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
analyze tree-wide: drop a few == NULL and != NULL comparison 2017-12-11 16:05:40 +01:00
ask-password Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
backlight Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
basic tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
binfmt Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
boot Merge pull request #7611 from poettering/bootspec-fixes 2017-12-12 22:16:34 +01:00
busctl tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
cgls Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
cgroups-agent Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
cgtop Add set/hashmap helpers for non-trivial freeing and use where straighforward 2017-11-28 21:30:30 +01:00
core tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
coredump tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
cryptsetup tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
debug-generator Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
delta Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
detect-virt Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dissect nspawn: make sure images containing an ESP are compatible with userns -U mode 2017-12-05 13:49:12 +01:00
environment-d-generator Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
escape Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
firstboot firstboot: do not write vconsole.conf when arg_keymap is empty 2017-11-25 19:11:57 +09:00
fsck Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
fstab-generator tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
getty-generator Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
gpt-auto-generator generators: be more careful when writing unit settings that support specifier expansion 2017-11-29 12:32:57 +01:00
hibernate-resume Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
hostname hostname-util: rework read_hostname_config() a bit 2017-11-20 16:43:15 +01:00
hwdb Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
import Remove NULL as last parameter to strjoin 2017-11-24 10:37:08 +00:00
initctl Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journal tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
journal-remote journal-upload: remove duplication of --help and --version in help text 2017-12-03 18:40:13 +01:00
kernel-install Add license headers and SPDX identifiers to meson.build files 2017-11-19 19:08:15 +01:00
libsystemd tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
libsystemd-network tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
libudev Replace free and return NULL with return mfree 2017-11-24 10:31:49 +00:00
locale tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
login tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
machine tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
machine-id-setup Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
modules-load Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
mount mount: use chase_symlinks() 2017-12-03 00:29:07 +09:00
network tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
notify Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
nspawn tree-wide: unify logging of "Must be root" message 2017-12-11 23:19:45 +01:00
nss-myhostname Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
nss-mymachines user-util: add UID_NOBODY defines that resolve to (uid_t) 65534 2017-12-06 13:40:50 +01:00
nss-resolve Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
nss-systemd user-util: add UID_NOBODY defines that resolve to (uid_t) 65534 2017-12-06 13:40:50 +01:00
partition growfs: fix building without libcrypsetup (#7535) 2017-12-04 10:31:04 +09:00
path Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
quotacheck Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
random-seed Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
rc-local-generator Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
remount-fs Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
reply-password Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
resolve tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
rfkill Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
run run: run pty forwarder at higher event priority than the bus 2017-12-05 18:33:24 +01:00
shared resolved: fix "in-between" logic when boundaries are equal (#7590) 2017-12-14 14:08:21 +09:00
sleep Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
socket-proxy Add set/hashmap helpers for non-trivial freeing and use where straighforward 2017-11-28 21:30:30 +01:00
stdio-bridge stdio-bridge: add missing option 2017-12-04 13:11:25 +09:00
sulogin-shell sulogin-shell: replace "^D" by "exit" 2017-12-07 12:42:06 +01:00
sysctl Use read_line() and LONG_LINE_MAX to read values configuration files. 2017-12-13 15:03:33 -02:00
system-update-generator Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
systemctl verbs: add a new VERB_MUSTBEROOT flag 2017-12-11 23:19:46 +01:00
systemd Add a "RequiredForOnline=" Link attribute for .network files (#7347) 2017-11-30 18:03:50 +01:00
sysusers Add set/hashmap helpers for non-trivial freeing and use where straighforward 2017-11-28 21:30:30 +01:00
sysv-generator generators: be more careful when writing unit settings that support specifier expansion 2017-11-29 12:32:57 +01:00
test resolved: fix "in-between" logic when boundaries are equal (#7590) 2017-12-14 14:08:21 +09:00
timedate Replace free and reassignment with free_and_replace 2017-11-24 10:33:41 +00:00
timesync man: "systemd" is to be written in all lower-case, even at beginnings of sentences 2017-12-13 17:42:04 +01:00
tmpfiles tmpfiles: also add %t/%S/%C/%L specifiers 2017-12-06 10:30:26 +01:00
tty-ask-password-agent tty-ask-password-agent: drop NULL sentinel 2017-11-29 20:12:26 +01:00
udev tree-wide: unify logging of "Must be root" message 2017-12-11 23:19:45 +01:00
update-done Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
update-utmp Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
user-sessions Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
vconsole tree-wide: drop a few == NULL and != NULL comparison 2017-12-11 16:05:40 +01:00
veritysetup util-lib: export cryptsetup logging glue function 2017-11-30 20:43:25 +01:00
volatile-root Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00