Systemd/src/shared
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
..
linux bpf: add new bpf.h header copy from 4.15 kernel 2018-02-21 16:43:36 +01:00
linux-3.13 Avoid strict DM interface version dependencies (#5519) 2017-03-02 19:11:37 +01:00
acl-util.c acl: fix typo in comment (#7580) 2017-12-08 13:34:25 +01:00
acl-util.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
acpi-fpdt.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
acpi-fpdt.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
apparmor-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
apparmor-util.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
ask-password-api.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
ask-password-api.h tty-ask-password-agent: reenable color for boot-time password prompt 2018-02-14 14:30:30 +01:00
base-filesystem.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
base-filesystem.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
boot-timestamps.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
boot-timestamps.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
bootspec.c shared/bootspec: look at the correct variable 2018-03-08 12:06:14 +01:00
bootspec.h Merge pull request #8086 from hdante/sdboot-setmode-v2 2018-03-07 10:41:44 +01:00
bus-unit-util.c core: drop unnecessary __useless_struct_to_allow_trailing_semicolon__ 2018-03-06 10:41:41 +01:00
bus-unit-util.h bus-unit-util: add socket unit related options 2017-12-23 18:48:16 +09:00
bus-util.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
bus-util.h bus-util: introduce bus_message_print_all_properties() 2018-03-20 00:44:37 +09:00
cgroup-show.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
cgroup-show.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
clean-ipc.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
clean-ipc.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
condition.c cocci: use strempty() at more places 2018-01-10 17:11:19 +01:00
condition.h condition: introduce condition_takes_path() 2018-01-02 02:23:26 +09:00
conf-parser.c shared/conf-parser: fix outdated comment 2018-03-21 13:15:01 +01:00
conf-parser.h systemd-link: Remove UDP Fragmentation Offload support. (#8183) 2018-03-18 14:28:14 +01:00
dev-setup.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dev-setup.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
dissect-image.c dissect: add dissect_image_and_warn() that unifies error message generation for dissect_image() (#8517) 2018-03-21 12:10:01 +01:00
dissect-image.h dissect: add dissect_image_and_warn() that unifies error message generation for dissect_image() (#8517) 2018-03-21 12:10:01 +01:00
dns-domain.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
dns-domain.h shared: introduce dnssd_srv_type_is_valid() function 2017-12-08 14:29:27 +02:00
dropin.c shared/dropin: ignore ENAMETOOLONG when checking drop-in directories (#7525) 2017-12-01 20:34:49 +01:00
dropin.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
efivars.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
efivars.h efivars: include errno.h when EFI support is disabled (#7900) 2018-01-17 20:25:42 +11:00
fdset.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
fdset.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
firewall-util.c shared: silence gcc warning (#7402) 2017-11-21 08:24:12 +01:00
firewall-util.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
fstab-util.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
fstab-util.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
generator.c generator: add helper function for writing unit files 2017-12-15 16:47:11 +01:00
generator.h generator: add helper function for writing unit files 2017-12-15 16:47:11 +01:00
gpt.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
ima-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
ima-util.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
import-util.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
import-util.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
initreq.h build-sys: move more files from core/ to share/ that are generic enough 2013-11-22 16:31:40 +01:00
install-printf.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
install-printf.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
install.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
install.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
journal-util.c journalctl: improve hint about lack of access for --user-unit=... 2018-02-20 22:36:01 +01:00
journal-util.h journalctl: improve hint about lack of access for --user-unit=... 2018-02-20 22:36:01 +01:00
libshared.sym shared: Add a linker script so that all functions are tagget @SD_SHARED instead of @Base (#6669) 2017-08-28 18:49:03 +02:00
logs-show.c Merge pull request #7881 from keszybz/pcre 2018-01-28 15:29:10 +01:00
logs-show.h journalctl: add highlighting for matched substring 2018-01-28 14:50:01 +01:00
loop-util.c stat-util: unify code that checks whether something is a regular file 2018-02-20 15:39:31 +01:00
loop-util.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
machine-image.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
machine-image.h machine-image: convert image_hashmap_free() to an static inline helper 2017-11-28 21:30:43 +01:00
machine-pool.c tree-wide: make use of wait_for_terminate_and_check() at various places 2018-01-04 13:27:27 +01:00
machine-pool.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
meson.build Merge pull request #7191 from Mic92/systemd 2018-01-09 14:35:54 +01:00
nsflags.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
nsflags.h nsflags: add namespace_flag_to_string_many_with_check() 2018-01-02 02:23:43 +09:00
output-mode.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
output-mode.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
pager.c basic/macros: rename noreturn into _noreturn_ (#8456) 2018-03-15 14:23:46 +09:00
pager.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
path-lookup.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
path-lookup.h shared: export xdg_user_dirs() and xdg_user_*_dir() 2017-12-06 10:18:11 +01:00
ptyfwd.c run: run pty forwarder at higher event priority than the bus 2017-12-05 18:33:24 +01:00
ptyfwd.h run: run pty forwarder at higher event priority than the bus 2017-12-05 18:33:24 +01:00
resolve-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
resolve-util.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
seccomp-util.c seccomp: add mmap and address family restrictions for MIPS (#8547) 2018-03-22 15:40:44 +01:00
seccomp-util.h seccomp: rework functions for parsing system call filters 2018-02-27 19:59:09 +01:00
sleep-config.c shared/sleep-config: fix unitialized variable and use STR_IN_SET (#8416) 2018-03-11 17:13:03 +09:00
sleep-config.h Introduce suspend-to-hibernate (#8274) 2018-03-08 14:17:33 +01:00
spawn-ask-password-agent.c pager,agent: insist that we are called from the main thread 2018-01-04 13:27:27 +01:00
spawn-ask-password-agent.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
spawn-polkit-agent.c pager,agent: insist that we are called from the main thread 2018-01-04 13:27:27 +01:00
spawn-polkit-agent.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
specifier.c macro: introduce TAKE_PTR() macro 2018-03-22 20:21:42 +01:00
specifier.h specifier: unify specifier implementations for user-related specifiers 2017-11-29 12:32:56 +01:00
switch-root.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
switch-root.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
sysctl-util.c sysctl: use raw file descriptor in sysctl_write (#7753) 2017-12-30 12:16:49 +01:00
sysctl-util.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-tables.h log: minimize includes in log.h 2018-01-11 14:44:31 +01:00
tests.c tree-wide: use EXIT_SUCCESS/EXIT_FAILURE in exit() where we can 2017-12-25 11:48:21 +01:00
tests.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
tomoyo-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
tomoyo-util.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
udev-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
udev-util.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
uid-range.c coccinelle: add reallocarray() coccinelle script 2018-03-02 12:39:07 +01:00
uid-range.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
utmp-wtmp.c coccinelle: O_NDELAY → O_NONBLOCK 2018-01-24 11:09:29 +01:00
utmp-wtmp.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
vlan-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
vlan-util.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
volatile-util.c log: minimize includes in log.h 2018-01-11 14:44:31 +01:00
volatile-util.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
watchdog.c coccinelle: make use of DIV_ROUND_UP() wherever appropriate 2018-03-20 20:59:02 +01:00
watchdog.h watchdog: allow a device path to be specified 2017-12-08 11:26:30 -06:00
wireguard-netlink.h networkd: add support for wireguard interface type 2018-01-09 14:00:49 +01:00