Systemd/src/core
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
..
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 coccinelle: make use of DIV_ROUND_UP() wherever appropriate 2018-03-20 20:59:02 +01: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: reset "extra" IP accounting counters when turning off IP accounting for a unit 2018-02-21 16:43:36 +01:00
bpf-firewall.h bpf: beef up bpf detection, check if BPF_F_ALLOW_MULTI is supported 2018-02-21 16:43:36 +01:00
cgroup.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
cgroup.h Merge pull request #8149 from poettering/fake-root-cgroup 2018-03-01 11:10:24 +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 dbus-automount: support more options in transient automount unit 2018-01-02 02:23:30 +09: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 core/cgroup: accepts MemorySwapMax=0 (#8366) 2018-03-09 11:34:50 +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 macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
dbus-execute.h core: rename bus_exec_command_set_transient_property() to bus_set_transient_exec_command() 2018-01-02 02:23:56 +09:00
dbus-job.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +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 dbus-kill: simplify bus_kill_context_set_transient_property() 2018-01-02 02:23:36 +09: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: add new dbus method GetDynamicUsers 2018-03-21 13:11:01 +09: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 dbus-mount: support more options in transient mount unit 2018-01-02 02:23:32 +09: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 dbus-path: add Paths= option to set path specs in transient path unit 2018-01-03 02:32:30 +09:00
dbus-path.h core/path: implement transient path unit 2017-12-15 09:10:34 +09:00
dbus-scope.c core: add new new bus call for migrating foreign processes to scope/service units 2018-02-12 11:34:00 +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 dbus-service: expose *ExitStatus= settings on bus 2018-01-03 02:32:10 +09: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 dbus-socket: simplify bus_socket_set_transient_property() 2018-01-02 02:25:04 +09: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: double free in bus_timer_set_transient_property 2018-01-04 11:31:37 +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: add new new bus call for migrating foreign processes to scope/service units 2018-02-12 11:34:00 +01:00
dbus-unit.h core: add new new bus call for migrating foreign processes to scope/service units 2018-02-12 11:34:00 +01:00
dbus-util.c dbus-util: properly parse timeout values 2018-01-11 15:12:16 +01:00
dbus-util.h core/cgroup: accepts MemorySwapMax=0 (#8366) 2018-03-09 11:34:50 +01:00
dbus.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
dbus.h core: don't process dbus unit and job queue when there are already too many messages pending 2018-02-27 19:54:29 +01:00
device.c When mangling names, optionally emit a warning (#8400) 2018-03-21 15:26:47 +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 macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
dynamic-user.h core: add new dbus method GetDynamicUsers 2018-03-21 13:11:01 +09:00
emergency-action.c basic: split out update_reboot_parameter_and_warn() into its own .c/.h files 2018-02-22 10:46:12 +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 macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
execute.h core: add new setting TemporaryFileSystem= 2018-02-21 09:17:52 +09: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 tree-wide: make use of new STRLEN() macro everywhere (#7639) 2017-12-14 19:02:29 +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 bpf: beef up bpf detection, check if BPF_F_ALLOW_MULTI is supported 2018-02-21 16:43:36 +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 Add build-time option to change the color of the "OK" status text 2018-03-02 09:00:44 +01:00
job.h pid1: rename job_check_gc to job_may_gc 2018-02-15 14:09:40 +01:00
kill.c cocci: use strempty() at more places 2018-01-10 17:11:19 +01:00
kill.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
killall.c shutdown: make kill timeout configurable (#7835) 2018-01-10 19:00:20 +01:00
killall.h shutdown: make kill timeout configurable (#7835) 2018-01-10 19:00:20 +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: add new setting TemporaryFileSystem= 2018-02-21 09:17:52 +09:00
load-fragment.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
load-fragment.h systemd-link: Remove UDP Fragmentation Offload support. (#8183) 2018-03-18 14:28:14 +01:00
locale-setup.c log: minimize includes in log.h 2018-01-11 14:44:31 +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 loopback-setup: update log message (#7956) 2018-01-23 09:50:31 +09: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 machine-id-setup: use return log_error… pattern 2017-12-19 15:20:38 +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 macros: fix sysusers_create_inline (#8489) 2018-03-19 18:05:49 +01:00
main.c main: add NoNewPrivileges config option (#8475) 2018-03-21 23:41:19 +01:00
manager.c move MANAGER_IS_RELOADING() check into manager_recheck_{dbus|journal}() (#8510) 2018-03-21 12:03:45 +01:00
manager.h Make MANAGER_TEST_RUN_MINIMAL just allocate data structures 2018-03-11 16:33:59 +01:00
meson.build Merge pull request #8202 from keszybz/avoid-msgmerge 2018-02-18 19:56:50 +01:00
mount-setup.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +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 shutdown: use libmount to enumerate /proc/self/mountinfo 2018-03-16 10:09:46 +01:00
mount.h mount: mountinfo event is supposed to always arrive before SIGCHLD 2018-01-23 11:09:06 +00:00
namespace.c Remove /sbin from paths if split-bin is false (#8324) 2018-03-01 21:48:36 +01:00
namespace.h core: add new option 'tmpfs' to ProtectHome= 2018-02-21 09:18:17 +09:00
org.freedesktop.systemd1.conf core: add new dbus method GetDynamicUsers 2018-03-21 13:11:01 +09:00
org.freedesktop.systemd1.policy.in meson: drop double .in suffix for o.fd.systemd1.policy file 2018-02-16 13:01:12 +01:00
org.freedesktop.systemd1.service Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
path.c core/path: add one more assert 2018-02-26 15:49:27 +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: add new new bus call for migrating foreign processes to scope/service units 2018-02-12 11:34:00 +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 selinux: make sure we never use /dev/null for making unit selinux access decisions 2018-01-31 19:54:25 +01:00
selinux-setup.c selinux: let's fully (and statically) initialize log callback union (#8512) 2018-03-21 11:48:40 +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 macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +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 shutdown: Don't limit unmount attempts prematurely (#8469) 2018-03-19 18:27:49 +09:00
slice.c Merge pull request #8149 from poettering/fake-root-cgroup 2018-03-01 11:10:24 +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/socket: support binary inside chroot when looking for SELinux label (#8405) 2018-03-09 12:20:56 +01:00
socket.h pid1: rename unit_check_gc to unit_may_gc 2018-02-15 13:04:12 +01:00
swap.c Merge pull request #8175 from keszybz/gc-cleanup 2018-02-15 17:47:37 +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.in main: add NoNewPrivileges config option (#8475) 2018-03-21 23:41:19 +01: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 core: don't freeze OnCalendar= timer units when the clock goes back a lot 2018-02-28 17:00:07 +00: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 rpm: add missing '-p <lua>' in trigger script (#8367) 2018-03-06 08:02:44 +01:00
umount.c core/umount: use libmount to enumerate /proc/swaps 2018-03-16 10:12:50 +01:00
umount.h test-umount: add a simple test for swap_list_get() 2018-03-16 10:12:50 +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 macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
unit.h Introduce _cleanup_(unit_freep) 2018-03-11 16:33:58 +01:00
user.conf core: rename StartLimitInterval= to StartLimitIntervalSec= 2016-04-29 16:27:48 +02:00