b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
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. |
4afd3348c7506dd1d36305b7bcb9feb8952b9d6b |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
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. |
07630cea1f3a845c09309f197ac7c4f11edd3b62 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
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. |
1c4baffc1895809bae9ac36b670af90a4cb9cd7d |
|
13-Jun-2015 |
Tom Gundersen <teg@jklm.no> |
sd-netlink: rename from sd-rtnl |
31710be527104abad7541b122ee10c4560bd14d2 |
|
11-Jun-2015 |
Tom Gundersen <teg@jklm.no> |
sd-rtnl: make joining broadcast groups implicit |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
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. |
8f084002eaf43e535f3697a31aeffb14946f9ab2 |
|
03-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
loopback-setup: simplify code a bit |
9ca903cceb9b0c9148e3050e800b3f422ab6aab8 |
|
03-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
loopback-setup: no need to redefine LOOPBACK_IFINDEX, we already have it in missing.h |
2f0af4e120385e6078c96189f4a4d0cce0e12a3a |
|
29-Dec-2014 |
Tom Gundersen <teg@jklm.no> |
core: loopback - correctly fail the loopback_check if somehow the rtnl calls fail |
e95e909d820429ba34fa6f6f1b0109ac22743b47 |
|
28-Dec-2014 |
Tom Gundersen <teg@jklm.no> |
core: loopback - simplify check_loopback()
We no longer configure the addresses on the loopback interface, but simply bring it up
and let the kernel do the rest. Also change the check to only check if the interface
is up, rather than checking for the IPv4 loopback address. |
58a489c2b3628f3003d3901537bec8b5e6c1b7bd |
|
27-Dec-2014 |
Stéphane Graber <stgraber@ubuntu.com> |
Fix check_loopback()
Add missing htonl() so that check_loopback() actually tests for 127.0.0.1
instead of 1.0.0.127 on little-endian machines. |
23bbb0de4e3f85d9704a5c12a5afa2dfa0159e41 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: more log_*_errno + return simplifications |
c33b329709ebe2755181980a050d02ec7c81ed87 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: more log_*_errno() conversions, multiline calls
Basically:
find . -name '*.[ch]' | while read f; do perl -i.mmm -e \
'local $/;
local $_=<>;
s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \
$f; done
Plus manual indentation fixups. |
f3fc48150bb443f5b4623a819ebc2b39971a4f66 |
|
08-Aug-2014 |
Tom Gundersen <teg@jklm.no> |
core: loopback-setup - only up the loopback device
The kernel will set up the IP addresses for us, so don't duplicate that
in userspace. |
151b9b9662a90455262ce575a8a8ae74bf4ff336 |
|
20-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
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. |
4fb7242cbbed0d865eb343548b8f0ee0fee71d85 |
|
18-Feb-2014 |
Tom Gundersen <teg@jklm.no> |
sd-rtnl-message: store reference to the bus in the message
This mimics the sd-bus api, as we may need it in the future. |
818dc5e72af8a3eb772997188e2bd8ea616de844 |
|
15-Feb-2014 |
Tom Gundersen <teg@jklm.no> |
sd-rtnl: always include linux/rtnetlink.h |
d595c5cc9e894c3608ed634052b0ba93aa94bf2f |
|
13-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
rtnl: rename constructors from the form sd_rtnl_xxx_yyy_new() to sd_rtnl_xxx_new_yyy()
So far we followed the rule to always indicate the "flavour" of
constructors after the "_new_" or "_open_" in the function name, so
let's keep things in sync here for rtnl and do the same. |
cf6a8911738fe2635a5210769d5348b05b166691 |
|
13-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
rtnl: drop "sd_" prefix from cleanup macros
The "sd_" prefix is supposed to be used on exported symbols only, and
not in the middle of names. Let's drop it from the cleanup macros hence,
to make things simpler.
The bus cleanup macros don't carry the "sd_" either, so this brings the
APIs a bit nearer. |
5a72317435a39f23520b42731e53bd13d20f489e |
|
22-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
sd-rtnl: simplify sd_rtnl_message_addr_new()
Split out into sd_rtnl_message_addr_set_{prefixlen,flags,scope}(). |
5d4795f3722911ccd7953c0cf112c1f7624ea834 |
|
22-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
sd-rtnl: link - allow setting the change mask |
753e98788a9bcbd3bba2b3006672c003ae72eefa |
|
19-Dec-2013 |
Tom Gundersen <teg@jklm.no> |
loopback-setup: correctly set flags and scope for ipv6 address |
2a700de47200837af24f848c08d752f652302c6e |
|
16-Dec-2013 |
Tom Gundersen <teg@jklm.no> |
loopback-setup: remove stray hunk |
0f49a5f75185bb358ee142f3c1c9f029a588435b |
|
16-Dec-2013 |
Tom Gundersen <teg@jklm.no> |
network: use SETLINK to bring up interfaces |
0a0dc69b655cfb10cab39133f5d521e7b35ce3d5 |
|
16-Dec-2013 |
Tom Gundersen <teg@jklm.no> |
rtnl: replace message_append by typesafe versions |
fc25d7f8050f262fa6cafeb2a1032e6eb3e7b412 |
|
16-Dec-2013 |
Tom Gundersen <teg@jklm.no> |
rtnl: simplify link_new()
Drop most of the arguments and instead introduce link_set_{flags,type}. |
81eca919f7cfa88bad8df7d7eac012f367c4c303 |
|
14-Nov-2013 |
Tom Gundersen <teg@jklm.no> |
loopback-setup: move to rtnl
This should be equivalent to the old behavior. |
7fd1b19bc9e9f5574f2877936b8ac267c7706947 |
|
18-Apr-2013 |
Harald Hoyer <harald@redhat.com> |
move _cleanup_ attribute in front of the type
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html |
b92bea5d2a9481de69bb627a7b442a9f58fca43d |
|
06-Apr-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Use initalization instead of explicit zeroing
Before, we would initialize many fields twice: first
by filling the structure with zeros, and then a second
time with the real values. We can let the compiler do
the job for us, avoiding one copy.
A downside of this patch is that text gets slightly
bigger. This is because all zero() calls are effectively
inlined:
$ size build/.libs/systemd
text data bss dec hex filename
before 897737 107300 2560 1007597 f5fed build/.libs/systemd
after 897873 107300 2560 1007733 f6075 build/.libs/systemd
… actually less than 1‰.
A few asserts that the parameter is not null had to be removed. I
don't think this changes much, because first, it is quite unlikely
for the assert to fail, and second, an immediate SEGV is almost as
good as an assert. |
e62d8c3944745ed276e6d4f33153009860e5cfc5 |
|
31-Mar-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Modernization
Use _cleanup_ and wrap lines to ~80 chars and such. |
2c3ff76eb004d71a70cb5e253cbca7332c53ac09 |
|
13-Apr-2012 |
Lennart Poettering <lennart@poettering.net> |
loopback: handle EPERM more gracefully |
08e1fb68d78b4adf26cce8387fc428b9e370bcf4 |
|
12-Apr-2012 |
Lennart Poettering <lennart@poettering.net> |
build-sys: move *-setup out of shared to avoid selinux being pulled in |