Systemd/src/libsystemd-network
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
..
arp-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
arp-util.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dhcp-identifier.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dhcp-identifier.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dhcp-internal.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dhcp-lease-internal.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dhcp-network.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dhcp-option.c Replace free and reassignment with free_and_replace 2017-11-24 10:33:41 +00:00
dhcp-packet.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dhcp-protocol.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dhcp-server-internal.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dhcp6-internal.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dhcp6-lease-internal.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dhcp6-network.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dhcp6-option.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dhcp6-protocol.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
icmp6-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
icmp6-util.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
lldp-internal.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
lldp-neighbor.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
lldp-neighbor.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
lldp-network.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
lldp-network.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
meson.build Add license headers and SPDX identifiers to meson.build files 2017-11-19 19:08:15 +01:00
ndisc-internal.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
ndisc-router.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
ndisc-router.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
network-internal.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
network-internal.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
radv-internal.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
sd-dhcp-client.c tree-wide: adjust fall through comments so that gcc is happy 2017-11-20 13:06:25 -08:00
sd-dhcp-lease.c tree-wide: use __fsetlocking() instead of fxyz_unlocked() 2017-12-14 10:42:25 +01:00
sd-dhcp-server.c Add set/hashmap helpers for non-trivial freeing and use where straighforward 2017-11-28 21:30:30 +01:00
sd-dhcp6-client.c tree-wide: adjust fall through comments so that gcc is happy 2017-11-20 13:06:25 -08:00
sd-dhcp6-lease.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
sd-ipv4acd.c tree-wide: adjust fall through comments so that gcc is happy 2017-11-20 13:06:25 -08:00
sd-ipv4ll.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
sd-lldp.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
sd-ndisc.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
sd-radv.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-acd.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-dhcp-client.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-dhcp-option.c Merge pull request #2589 from keszybz/resolve-tool-2 2016-02-13 11:15:41 +01:00
test-dhcp-server.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-dhcp6-client.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-ipv4ll-manual.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-ipv4ll.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-lldp.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-ndisc-ra.c test-ndisc-ra: add assert_se() to make coverity happy 2017-11-28 09:25:38 +01:00
test-ndisc-rs.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-sd-dhcp-lease.c network: Implement DHCP Option 119 (Domain Search List) (#5932) 2017-05-13 10:19:32 -04:00