Systemd/src
Lennart Poettering ae2a15bc14 macro: introduce TAKE_PTR() macro
This macro will read a pointer of any type, return it, and set the
pointer to NULL. This is useful as an explicit concept of passing
ownership of a memory area between pointers.

This takes inspiration from Rust:

https://doc.rust-lang.org/std/option/enum.Option.html#method.take

and was suggested by Alan Jenkins (@sourcejedi).

It drops ~160 lines of code from our codebase, which makes me like it.
Also, I think it clarifies passing of ownership, and thus helps
readability a bit (at least for the initiated who know the new macro)
2018-03-22 20:21:42 +01:00
..
ac-power ac-power: add simple getopt() argument parsing to systemd-ac-power (#8516) 2018-03-21 12:52:18 +01:00
activate tree-wide: port various places over to use new rearrange_stdio() 2018-03-02 11:42:10 +01:00
analyze bus-util: make bus_map_all_properties() not copy string 2018-03-20 00:42:48 +09:00
ask-password
backlight
basic macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
binfmt
boot boot: also use _cleanup_freepool_ in util.c 2018-03-13 11:42:02 +01:00
busctl macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
cgls tree-wide: voidify pager_open() 2018-03-19 21:04:02 +09:00
cgroups-agent
cgtop Merge pull request #8149 from poettering/fake-root-cgroup 2018-03-01 11:10:24 +01:00
core macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
coredump macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
cryptsetup macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
debug-generator When mangling names, optionally emit a warning (#8400) 2018-03-21 15:26:47 +01:00
delta tree-wide: voidify pager_open() 2018-03-19 21:04:02 +09:00
detect-virt
dissect dissect: add dissect_image_and_warn() that unifies error message generation for dissect_image() (#8517) 2018-03-21 12:10:01 +01:00
environment-d-generator macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
escape When mangling names, optionally emit a warning (#8400) 2018-03-21 15:26:47 +01:00
firstboot macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
fsck tree-wide: make use of wait_for_terminate_and_check() at various places 2018-01-04 13:27:27 +01:00
fstab-generator When mangling names, optionally emit a warning (#8400) 2018-03-21 15:26:47 +01:00
fuzz fuzz-unit-file: fix check if ListenNetlink is used 2018-03-21 13:16:52 +01:00
getty-generator log: remove LOG_TARGET_SAFE pseudo log target 2018-01-24 18:22:56 +01:00
gpt-auto-generator log: remove LOG_TARGET_SAFE pseudo log target 2018-01-24 18:22:56 +01:00
hibernate-resume log: remove LOG_TARGET_SAFE pseudo log target 2018-01-24 18:22:56 +01:00
hostname bus-util: make bus_map_all_properties() not copy string 2018-03-20 00:42:48 +09:00
hwdb networkctl,hwdb: make verbs static 2018-03-19 21:03:35 +09:00
import macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
initctl log: minimize includes in log.h 2018-01-11 14:44:31 +01:00
journal macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
journal-remote journal: provide compress_threshold_bytes parameter 2018-03-20 11:48:52 -07:00
kernel-install kernel-install: Don't install BLS kernel images if dest dir doesn't exist (#8306) 2018-02-28 10:25:19 +01:00
libsystemd macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
libsystemd-network macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
libudev macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
locale macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
login macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
machine macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
machine-id-setup
modules-load
mount macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
network macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
notify notify: add new --uid= command 2018-01-11 15:12:16 +01:00
nspawn macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
nss-myhostname
nss-mymachines nss-mymachines: add work-around to silence gcc warning 2018-02-06 17:08:42 +09:00
nss-resolve resolve: Adjust and unify D-Bus call timeout (#7847) 2018-01-23 09:53:31 +09:00
nss-systemd nss-systemd: make dynamic users enumerable by `getent` 2018-03-21 13:39:03 +09:00
partition log: minimize includes in log.h 2018-01-11 14:44:31 +01:00
path
quotacheck process-spec: add another flag FORK_WAIT to safe_fork() 2018-01-04 13:27:27 +01:00
random-seed
rc-local-generator log: remove LOG_TARGET_SAFE pseudo log target 2018-01-24 18:22:56 +01:00
remount-fs process-util: add another fork_safe() flag for enabling LOG_ERR/LOG_WARN logging 2018-01-04 13:27:26 +01:00
reply-password
resolve macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
rfkill
run When mangling names, optionally emit a warning (#8400) 2018-03-21 15:26:47 +01:00
shared macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
sleep Introduce suspend-to-hibernate (#8274) 2018-03-08 14:17:33 +01:00
socket-proxy
stdio-bridge
sulogin-shell process-util: rework wait_for_terminate_and_warn() to take a flags parameter 2018-01-04 13:27:27 +01:00
sysctl tree-wide: use path_hash_ops instead of string_hash_ops whenever we key by a path 2018-02-12 11:07:55 +01:00
system-update-generator log: remove LOG_TARGET_SAFE pseudo log target 2018-01-24 18:22:56 +01:00
systemctl macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
systemd dhcp4: introduce new option 'duid-only' for ClientIdentifier= (#8350) 2018-03-12 17:18:07 +01:00
sysusers user-util: add new wrappers for reading/writing {passwd,shadow,gshadow} database files (#8521) 2018-03-21 15:26:02 +01:00
sysv-generator macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
test When mangling names, optionally emit a warning (#8400) 2018-03-21 15:26:47 +01:00
time-wait-sync time-sync-wait: add service (#8494) 2018-03-21 12:42:04 +01:00
timedate bus-util: make bus_map_all_properties() not copy string 2018-03-20 00:42:48 +09:00
timesync tree-wide: use "cannot" instead of "can not" 2018-02-08 10:34:52 +01:00
tmpfiles macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
tty-ask-password-agent fixed 3 occurences of 'Failed top open' (#8349) 2018-03-04 21:12:45 +09:00
udev macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
update-done
update-utmp
user-sessions nologin: extend the /run/nologin descriptions a bit (#8244) 2018-02-22 14:21:30 +01:00
vconsole macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
veritysetup log: remove LOG_TARGET_SAFE pseudo log target 2018-01-24 18:22:56 +01:00
volatile-root