Commit Graph

17 Commits

Author SHA1 Message Date
Lennart Poettering df0ff12775 tree-wide: make use of getpid_cached() wherever we can
This moves pretty much all uses of getpid() over to getpid_raw(). I
didn't specifically check whether the optimization is worth it for each
replacement, but in order to keep things simple and systematic I
switched over everything at once.
2017-07-20 20:27:24 +02:00
Daniel Mack b26fa1a2fb tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file.
2016-02-10 13:41:57 +01:00
Thomas Hindoe Paaboel Andersen cf0fbc49e6 tree-wide: sort includes
Sort the includes accoding to the new coding style.
2015-11-16 22:09:36 +01:00
Lennart Poettering b5efdb8af4 util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
Lennart Poettering 3ffd4af220 util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over.
2015-10-25 13:19:18 +01:00
Lennart Poettering 07630cea1f util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.

This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.

Also touches a few unrelated include files.
2015-10-24 23:05:02 +02:00
Thomas Hindoe Paaboel Andersen 2eec67acbb remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use.
2015-02-23 23:53:42 +01:00
David Herrmann 4d2b1e0a3f bus: don't rely on static IDs in tests
We should never put any constraints on the IDs returned by the kernel. Use
sd_bus_get_unique_name() to retrieve the ID of a peer.
2015-02-17 18:16:07 +01:00
Lennart Poettering 7dcd79c295 sd-bus: properly support passing memfds around with offset/size parameters 2014-12-09 18:07:46 +01:00
Lennart Poettering d55192add7 busctl: introduce busctl "get-property" command for reading and dumping object properties 2014-11-14 17:52:40 +01:00
Lennart Poettering a09abc4ae0 memfd: rename memfd.h to memfd-util.h to avoid any confusion with any libc provided headers 2014-10-30 18:32:37 +01:00
Lennart Poettering 4531a9bc20 memfd: simplify API
Now, that the memfd stuff is not exported anymore, we can simplify a few
things:

Use assert() instead of assert_return(), since this is used internally
only, and we should be less permissive then.

No need to pass an allocated fd back by call-by-reference, we can just
directly return it.
2014-08-19 19:39:16 +02:00
Daniel Mack fac9c0d508 memfd: internalize functions, drop sd_memfd type
Remove the sd_ prefix from internal functions and get rid of the sd_memfd
type. As a memfd is now just a native file descriptor, we can get rid of our
own wrapper type, and also use close() and dup() on them directly.
2014-08-18 13:32:08 +02:00
Daniel Mack 43bde981cc memfd: move code from public library to src/shared
Don't expose generic kernel API via libsystemd, but keep the code internal
for our own usage.
2014-08-18 12:37:20 +02:00
Lennart Poettering 151b9b9662 api: in constructor function calls, always put the returned object pointer first (or second)
Previously the returned object of constructor functions where sometimes
returned as last, sometimes as first and sometimes as second parameter.
Let's clean this up a bit. Here are the new rules:

1. The object the new object is derived from is put first, if there is any

2. The object we are creating will be returned in the next arguments

3. This is followed by any additional arguments

Rationale:

For functions that operate on an object we always put that object first.
Constructors should probably not be too different in this regard. Also,
if the additional parameters might want to use varargs which suggests to
put them last.

Note that this new scheme only applies to constructor functions, not to
all other functions. We do give a lot of freedom for those.

Note that this commit only changes the order of the new functions we
added, for old ones we accept the wrong order and leave it like that.
2014-02-20 00:03:10 +01:00
Lennart Poettering 7f96b1d814 bus: extend memfd api so that we can label memfds for debugging purposes 2014-01-22 13:06:04 +01:00
Tom Gundersen 607553f930 libsystemd: split up into subdirs
We still only produce on .so, but let's keep the sources separate to make things a bit
less messy.
2014-01-21 14:41:35 +01:00
Renamed from src/libsystemd/test-bus-zero-copy.c (Browse further)