Systemd/src/core
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-fd.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
audit-fd.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
automount.c core/automount: load() should fail when the unit file does not exist 2017-11-20 09:35:30 +09:00
automount.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
bpf-firewall.c bpf-firewall: actually invoke BPF_PROG_ATTACH to check whether cgroup/bpf is available 2017-11-29 20:15:23 +01:00
bpf-firewall.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
cgroup.c core: warn about left-over processes in cgroup on unit start 2017-11-25 17:08:21 +01:00
cgroup.h core: warn about left-over processes in cgroup on unit start 2017-11-25 17:08:21 +01:00
chown-recursive.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
chown-recursive.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dbus-automount.c core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-automount.h core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-cgroup.c tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
dbus-cgroup.h core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-device.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dbus-device.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dbus-execute.c tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
dbus-execute.h core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-job.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dbus-job.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dbus-kill.c core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-kill.h core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-manager.c core: make "taint" string logic a bit more generic and output it at boot 2017-12-07 11:27:07 +01:00
dbus-manager.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dbus-mount.c core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-mount.h core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-path.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dbus-path.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dbus-scope.c core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-scope.h core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-service.c tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
dbus-service.h core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-slice.c core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-slice.h core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-socket.c core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-socket.h core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-swap.c core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-swap.h core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-target.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dbus-target.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dbus-timer.c core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-timer.h core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus-unit.c core: allow changing the description for units dynamically at runtime 2017-11-29 12:34:12 +01:00
dbus-unit.h core: add proper escaping to writing of drop-ins/transient unit files 2017-11-29 12:34:12 +01:00
dbus.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dbus.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
device.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
device.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dynamic-user.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dynamic-user.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
emergency-action.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
emergency-action.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
execute.c tree-wide: drop a few == NULL and != NULL comparison 2017-12-11 16:05:40 +01:00
execute.h Merge pull request #7198 from poettering/stdin-stdout 2017-11-19 19:49:11 +01:00
hostname-setup.c hostname-util: rework read_hostname_config() a bit 2017-11-20 16:43:15 +01:00
hostname-setup.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
ima-setup.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
ima-setup.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
ip-address-access.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
ip-address-access.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
job.c Replace use of snprintf with xsprintf 2017-11-24 10:36:04 +00:00
job.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
kill.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
kill.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
killall.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
killall.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
kmod-setup.c Fix build without libkmod 2017-11-24 13:54:20 +01:00
kmod-setup.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
load-dropin.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
load-dropin.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
load-fragment-gperf-nulstr.awk build-sys: fix the script used for generating load_fragment_gperf_nulstr (#6646) 2017-08-26 23:21:23 +09:00
load-fragment-gperf.gperf.m4 core: enable specifier expansion for What=/Where=/Type=/SourcePath= too 2017-11-29 12:32:57 +01:00
load-fragment.c core: merge multiple CPUAffinity= settings 2017-12-06 10:32:42 +09:00
load-fragment.h Merge pull request #7198 from poettering/stdin-stdout 2017-11-19 19:49:11 +01:00
locale-setup.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
locale-setup.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
loopback-setup.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
loopback-setup.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
machine-id-setup.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
machine-id-setup.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
macros.systemd.in Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
main.c tree-wide: drop a few == NULL and != NULL comparison 2017-12-11 16:05:40 +01:00
manager.c tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
manager.h core: make "taint" string logic a bit more generic and output it at boot 2017-12-07 11:27:07 +01:00
meson.build Add license headers and SPDX identifiers to meson.build files 2017-11-19 19:08:15 +01:00
mount-setup.c Fix SELinux labels in cgroup filesystem root directory (#7496) 2017-11-30 11:59:29 +01:00
mount-setup.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
mount.c core: warn about left-over processes in cgroup on unit start 2017-11-25 17:08:21 +01:00
mount.h core: unify common code for preparing for forking off unit processes 2017-11-21 11:54:08 +01:00
namespace.c nspawn: make sure images containing an ESP are compatible with userns -U mode 2017-12-05 13:49:12 +01:00
namespace.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
org.freedesktop.systemd1.conf Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
org.freedesktop.systemd1.policy.in.in Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
org.freedesktop.systemd1.service Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
path.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
path.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
scope.c core: generalize the cgroup empty check on GC 2017-11-25 17:08:21 +01:00
scope.h core: track scope controllers on the bus 2017-11-23 21:47:48 +01:00
selinux-access.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
selinux-access.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
selinux-setup.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
selinux-setup.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
service.c service: Don't stop unneeded units needed by restarted service (#7526) 2017-12-05 16:51:19 +01:00
service.h service: Don't stop unneeded units needed by restarted service (#7526) 2017-12-05 16:51:19 +01:00
show-status.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
show-status.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
shutdown.c core: Add WatchdogDevice config option and implement it 2017-12-08 11:26:44 -06:00
slice.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
slice.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
smack-setup.c tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
smack-setup.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
socket.c core: warn about left-over processes in cgroup on unit start 2017-11-25 17:08:21 +01:00
socket.h core: unify common code for preparing for forking off unit processes 2017-11-21 11:54:08 +01:00
swap.c core: warn about left-over processes in cgroup on unit start 2017-11-25 17:08:21 +01:00
swap.h core: unify common code for preparing for forking off unit processes 2017-11-21 11:54:08 +01:00
system.conf manager: hook up IP accounting defaults 2017-09-22 15:24:55 +02:00
systemd.pc.in build-sys: make the dynamic UID range, and the container UID range configurable 2017-12-06 12:55:37 +01:00
target.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
target.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
timer.c Merge pull request #7406 from poettering/timestamp-rework 2017-11-22 11:55:04 +01:00
timer.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
transaction.c Replace free and return NULL with return mfree 2017-11-24 10:31:49 +00:00
transaction.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
triggers.systemd.in Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
umount.c core/umount: use _cleanup_ in one more place 2017-11-28 09:25:38 +01:00
umount.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
unit-printf.c specifier: unify specifier implementations for user-related specifiers 2017-11-29 12:32:56 +01:00
unit-printf.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
unit.c core: use empty_to_null() where we can 2017-12-07 12:13:00 +01:00
unit.h service: Don't stop unneeded units needed by restarted service (#7526) 2017-12-05 16:51:19 +01:00
user.conf core: rename StartLimitInterval= to StartLimitIntervalSec= 2016-04-29 16:27:48 +02:00