Systemd/src/core
Lennart Poettering 4afd3348c7 tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy
GLIB has recently started to officially support the gcc cleanup
attribute in its public API, hence let's do the same for our APIs.

With this patch we'll define an xyz_unrefp() call for each public
xyz_unref() call, to make it easy to use inside a
__attribute__((cleanup())) expression. Then, all code is ported over to
make use of this.

The new calls are also documented in the man pages, with examples how to
use them (well, I only added docs where the _unref() call itself already
had docs, and the examples, only cover sd_bus_unrefp() and
sd_event_unrefp()).

This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we
tend to call our destructors these days.

Note that this defines no public macro that wraps gcc's attribute and
makes it easier to use. While I think it's our duty in the library to
make our stuff easy to use, I figure it's not our duty to make gcc's own
features easy to use on its own. Most likely, client code which wants to
make use of this should define its own:

       #define _cleanup_(function) __attribute__((cleanup(function)))

Or similar, to make the gcc feature easier to use.

Making this logic public has the benefit that we can remove three header
files whose only purpose was to define these functions internally.

See #2008.
2015-11-27 19:19:36 +01:00
..
.gitignore Move daemon-reload from package %post scripts to file triggers 2015-11-15 18:38:37 -05:00
audit-fd.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
audit-fd.h
automount.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
automount.h Move all unit states to basic/ and extend systemctl --state=help 2015-09-28 15:09:34 -04:00
bus-endpoint.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
bus-endpoint.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
bus-policy.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
bus-policy.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
busname.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
busname.h util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
cgroup.c core: don't generate warnings when write access to the cgroup fs fails in --user due to EACCES 2015-11-17 00:52:10 +01:00
cgroup.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
dbus-automount.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
dbus-automount.h remove unused includes 2015-02-23 23:53:42 +01:00
dbus-busname.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
dbus-busname.h remove unused includes 2015-02-23 23:53:42 +01:00
dbus-cgroup.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
dbus-cgroup.h util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
dbus-device.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
dbus-device.h remove unused includes 2015-02-23 23:53:42 +01:00
dbus-execute.c execute: Add new PassEnvironment= directive 2015-11-11 07:55:23 -08:00
dbus-execute.h util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
dbus-job.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
dbus-job.h util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
dbus-kill.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
dbus-kill.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
dbus-manager.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
dbus-manager.h core: emit changes for NFailedUnits property 2015-02-26 09:38:50 -05:00
dbus-mount.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
dbus-mount.h util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
dbus-path.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
dbus-path.h remove unused includes 2015-02-23 23:53:42 +01:00
dbus-scope.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
dbus-scope.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
dbus-service.c core: expose number of file descriptors in fd store on the bus 2015-11-02 23:44:05 +01:00
dbus-service.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
dbus-slice.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
dbus-slice.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
dbus-socket.c Socket: socket protocol add to dbus properties 2015-11-18 09:34:19 +05:30
dbus-socket.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
dbus-swap.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
dbus-swap.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
dbus-target.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
dbus-target.h util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
dbus-timer.c core: rename Random* to RandomizedDelay* 2015-11-26 16:32:41 -05:00
dbus-timer.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
dbus-unit.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
dbus-unit.h Merge pull request #1828 from fbuihuu/set-property-on-inactive-unit 2015-11-27 14:00:57 +01:00
dbus.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
dbus.h core: pass details to polkit for some unit actions 2015-09-06 00:07:17 +10:00
device.c tree-wide: group include of libudev.h with sd-* 2015-11-17 07:06:08 +01:00
device.h Move all unit states to basic/ and extend systemctl --state=help 2015-09-28 15:09:34 -04:00
execute.c core:execute: fix fork() fail handling in exec_spawn() 2015-11-27 14:15:33 +01:00
execute.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
failure-action.c core: unify code that warns about jobs we fail to enqueue 2015-11-12 20:14:06 +01:00
failure-action.h
hostname-setup.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
hostname-setup.h
ima-setup.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
ima-setup.h
job.c core: Minor cleaning up of unit/log status and log logic 2015-11-17 20:41:52 +01:00
job.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
kill.c util-lib: move string table stuff into its own string-table.[ch] 2015-10-27 13:25:56 +01:00
kill.h core: extend KillUnit() to return error when no unit was killed 2015-09-21 10:05:49 +02:00
killall.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
killall.h
kmod-setup.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
kmod-setup.h
load-dropin.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
load-dropin.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
load-fragment-gperf.gperf.m4 core: rename Random* to RandomizedDelay* 2015-11-26 16:32:41 -05:00
load-fragment.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
load-fragment.h socket: Add support for socket protcol 2015-11-18 09:34:18 +05:30
locale-setup.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
locale-setup.h
loopback-setup.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
loopback-setup.h
machine-id-setup.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
machine-id-setup.h machine-id-setup: add a machine_id_commit call to commit on disk a transient machine-id 2014-12-03 03:41:19 +01:00
macros.systemd.in rpm: fix %systemd_user_post() macro. 2015-11-22 20:38:05 +01:00
main.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
Makefile
manager.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
manager.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
mount-setup.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
mount-setup.h mount-setup: remove mount_setup_late() 2014-11-14 15:18:56 +01:00
mount.c core: Do not bind a mount unit to a device, if it was from mountinfo 2015-11-24 14:08:50 +01:00
mount.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
namespace.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
namespace.h core: Private*/Protect* options with RootDirectory 2015-05-18 18:47:45 +02:00
org.freedesktop.systemd1.conf
org.freedesktop.systemd1.policy.in.in core: rework policykit hookup 2015-02-18 18:56:27 +01:00
org.freedesktop.systemd1.service
path.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
path.h Move all unit states to basic/ and extend systemctl --state=help 2015-09-28 15:09:34 -04:00
scope.c core: simplify scope unit GC checking code a bit 2015-11-13 19:50:52 +01:00
scope.h Move all unit states to basic/ and extend systemctl --state=help 2015-09-28 15:09:34 -04:00
selinux-access.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
selinux-access.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
selinux-setup.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
selinux-setup.h
service.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
service.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
show-status.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
show-status.h util-lib: move status printing stuff into src/core/ 2015-10-27 13:25:56 +01:00
shutdown.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
slice.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
slice.h Move all unit states to basic/ and extend systemctl --state=help 2015-09-28 15:09:34 -04:00
smack-setup.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
smack-setup.h
socket.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
socket.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
swap.c core: Do not bind a mount unit to a device, if it was from mountinfo 2015-11-24 14:08:50 +01:00
swap.h util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
system.conf core: enable TasksMax= for all services by default, and set it to 512 2015-11-16 11:57:48 +01:00
systemd.pc.in build-sys: move systemd.pc from pkgconfiglibdir back into pkgconfigdatadir 2015-04-21 20:35:17 +02:00
target.c core: remove support for RequiresOverridable= and RequisiteOverridable= 2015-11-12 19:27:24 +01:00
target.h Move all unit states to basic/ and extend systemctl --state=help 2015-09-28 15:09:34 -04:00
timer.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
timer.h core: add new RandomSec= setting for time units 2015-11-18 17:07:11 +01:00
transaction.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
transaction.h tree-wide: sort includes in *.h 2015-11-18 23:09:02 +01:00
triggers.systemd.in Convert file trigger scripts to lua 2015-11-23 11:32:20 -05:00
umount.c tree-wide: group include of libudev.h with sd-* 2015-11-17 07:06:08 +01:00
umount.h
unit-printf.c core: simplify handling of %u, %U, %s and %h unit file specifiers 2015-11-12 17:57:04 +01:00
unit-printf.h
unit.c tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy 2015-11-27 19:19:36 +01:00
unit.h core: Do not bind a mount unit to a device, if it was from mountinfo 2015-11-24 14:08:50 +01:00
user.conf core: Support system.conf.d and user.conf.d directories in the usual search paths 2014-11-29 13:55:31 -05:00