summaryrefslogtreecommitdiff
path: root/src/libelogind/sd-bus/bus-slot.c
Commit message (Collapse)AuthorAge
* tree-wide: remove Lennart's copyright linesLennart Poettering2018-08-24
| | | | | | | | | | | These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-08-24
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* bus: optionally call a callbacks for cleanupZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | | | | | | This adds a function sd_bus_slot_set_destroy_callback() to set a function which can free userdata or perform other cleanups. sd_bus_slot_get_destory_callback() queries the callback, and is included for completeness. Without something like this, for floating asynchronous callbacks, which might be called or not, depending on the sequence of events, it's hard to perform resource cleanup. The alternative would be to always perform the cleanup from the caller too, but that requires more coordination and keeping of some shared state. It's nicer to keep the cleanup contained between the callback and the function that requests the callback.
* bus-slot: for bus slot objects with no explicit description use the match ↵Lennart Poettering2018-08-24
| | | | | | | string as description Let's make debugging a but easier with implicit descriptions for some match objects.
* sd-bus: add new sd_bus_slot_set_floating() callLennart Poettering2018-08-24
| | | | | | | | | | This new call allows explicit control of the "floating" state of a bus slot object. This is useful for creating a bus slot object first, retaining a reference to it, using it for making changes to the slot object (for example, set a description) and then handing it over to sd-bus for lifecycle management. It's also useful to fix #8551.
* tree-wide: drop spurious newlines (#8764)Lennart Poettering2018-08-24
| | | | | | | | | Double newlines (i.e. one empty lines) are great to structure code. But let's avoid triple newlines (i.e. two empty lines), quadruple newlines, quintuple newlines, …, that's just spurious whitespace. It's an easy way to drop 121 lines of code, and keeps the coding style of our sources a bit tigther.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* sd-bus: when disconnecting a slot, also reset its memoryLennart Poettering2018-05-30
| | | | | Yes, we aren#t accessing this anymore after, but it's still nicer if this is actually guaranteed.
* sd-bus: add asynchronous version of sd_bus_match()Lennart Poettering2018-05-30
| | | | | | | We usually enqueue a number of these calls on each service initialization. Let's do this asynchronously, and thus remove synchronization points. This improves both performance behaviour and reduces the chances to deadlock.
* sd-bus: when removing a server-side match, do so in "fire and forget" fashionLennart Poettering2018-05-30
| | | | | | | We currently wait for the RemoveMatch() reply, but then ignore what it actually says. Let's optimize this a bit, and not even ask for an answer back: just enqueue the RemoveMatch() operation, and do not request not wait for any answer.
* sd-bus: start reply callback timeouts only when the connection is establishedLennart Poettering2018-05-30
| | | | | | | | | | | | | | | | | | | | | | | | Currently, reply callback timeouts are started the instant the method calls are enqueued, which can be very early on. For example, the Hello() method call is enqueued right when sd_bus_start() is called, i.e. before the socket connection and everything is established. With this change we instead start the method timeout the moment we actually leave the authentication phase of the connection. This way, the timeout the kernel applies on socket connecting, and we apply on the authentication phase no longer runs in parallel to the Hello() method call, but all three run serially one after the other, which is definitely a cleaner approach. Moreover, this makes the "watch bind" feature a lot more useful, as it allows enqueuing method calls while we are still waiting for inotify events, without them timeouting until the connection is actually established, i.e. when the method call actually has a chance of being actually run. This is a change of behaviour of course, but I think the new behaviour is much better than the old one, since we don't race timeouts against each other anymore...
* Prep v236 : Add missing SPDX-License-Identifier (4/9) src/libelogindSven Eden2018-03-26
|
* Prep 229.9: Make all supportable API functions visible.Sven Eden2017-12-12
| | | | | | | | | | The process of cleaning up elogind, meaning to mask all bits that are unneeded by elogind, has been finished a while ago. It is therefore time to re-enable all previously masked API functions that elogind can support. This will make it easier for future developers to integrate elogind into their software where they already support systemd-login.
* sd-bus: drop match cookie conceptLennart Poettering2017-09-29
| | | | | | THe match cookie was used by kdbus to identify matches we install uniquely. But given that kdbus is gone, the cookie serves no process anymore, let's kill it.
* tree-wide: use mfree moreZbigniew Jędrzejewski-Szmek2017-07-05
|
* tree-wide: make ++/-- usage consistent WRT spacingVito Caputo2017-06-16
| | | | | | Throughout the tree there's spurious use of spaces separating ++ and -- operators from their respective operands. Make ++ and -- operator consistent with the majority of existing uses; discard the spaces.
* Prep v229: Remove remaining emacs settings [3/6] src/libelogindSven Eden2017-05-17
|
* tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easyLennart Poettering2017-05-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Prep v228: Condense elogind source masks (4/5)Sven Eden2017-04-26
|
* Prep v228: Add remaining updates from upstream (3/3)Sven Eden2017-04-26
| | | | | Apply remaining fixes and the performed move of utility functions into their own foo-util.[hc] files on the rest of elogind.
* Prep v221: Update and clean up build system to sync with upstreamSven Eden2017-03-14
| | | | | | | | | | | | | | This commit replays the moving around of source files that have been done between systemd-219 and systemd-221. Further the Makefile.am is synchronized with the upstream version and then "re-cleaned". A lot of functions, that are not used anywhere in elogind have been coated into #if 0/#endif directives to further shorten the list of dependencies. All unneeded files have been removed.
* sd-bus: sd_bus_slot_get_description() should return const stringsDavid Herrmann2017-03-14
| | | | | | | | | | All other *_get_description() functions use 'const char**', so make sure sd_bus_slot_get_description() does the same. This changes API, but ABI stays stable. I think this is fine, but I wouldn't mind bumping SONAME. Reported in #528.
* sd-bus: suppress installing local bus matches server sideLennart Poettering2017-03-14
| | | | | | | | | Matches that can only match against messages from the org.freedesktop.DBus.Local service (or the local interfaces or path) should never be installed server side, suppress them hence. Similar, on kdbus matches that can only match driver messages shouldn't be passed to the kernel.
* Rename more things to elogindAndy Wingo2015-04-19