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. |
3ffd4af22052963e7a29431721ee204e634bea75 |
|
25-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
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. |
266f3e269d173f104aa2a5e3ceac9b6979ea5039 |
|
29-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
bus-util: rename bus_open_transport() to bus_connect_transport()
In sd-bus, the sd_bus_open_xyz() family of calls allocates a new bus,
while sd_bus_default_xyz() family tries to reuse the thread's default
bus. bus_open_transport() sometimes internally uses the former,
sometimes the latter family, but suggests it only calls the former via
its name. Hence, let's avoid this confusion, and generically rename the
call to bus_connect_transport().
Similar for all related calls.
And while we are at it, also change cgls + cgtop to do direct systemd
connections where possible, since all they do is talk to systemd itself. |
3f6fd1ba65f962702753c4ad284b588e59689a23 |
|
29-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
util: introduce common version() implementation and use it everywhere
This also allows us to drop build.h from a ton of files, hence do so.
Since we touched the #includes of those files, let's order them properly
according to CODING_STYLE. |
75f86906c52735c98dc0aa7e24b773edb42ee814 |
|
07-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
basic: rework virtualization detection API
Introduce a proper enum, and don't pass around string ids anymore. This
simplifies things quite a bit, and makes virtualization detection more
similar to architecture detection. |
7d6884b65e6ea7317346d29bc2f6c9ba051a0cac |
|
06-Aug-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
tree-wide: fix indentation |
03976f7b4a84b8b1492a549a3470b2bba8f37008 |
|
03-Jul-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: introduce new sd_bus_flush_close_unref() call
sd_bus_flush_close_unref() is a call that simply combines sd_bus_flush()
(which writes all unwritten messages out) + sd_bus_close() (which
terminates the connection, releasing all unread messages) +
sd_bus_unref() (which frees the connection).
The combination of this call is used pretty frequently in systemd tools
right before exiting, and should also be relevant for most external
clients, and is hence useful to cover in a call of its own.
Previously the combination of the three calls was already done in the
_cleanup_bus_close_unref_ macro, but this was only available internally.
Also see #327 |
e7e55dbdc38f929805ab2407fbd50886043a9e7c |
|
14-Jun-2015 |
David Herrmann <dh.herrmann@gmail.com> |
tree-wide: fix memory leaks in users of bus_map_all_properties()
If you use bus_map_all_properties(), you must be aware that it might
touch output variables even though it may fail. This is, because we parse
many different bus-properties and cannot tell how to clean them up, in
case we fail deep down in the parser.
Fix all callers of bus_map_all_properties() to correctly cleanup any
context structures at all times. |
ff9b60f38bf68eba4a47cabff14547d92e083214 |
|
11-May-2015 |
Torstein Husebø <torstein@huseboe.net> |
treewide: Correct typos and spell plural of bus consistent |
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. |
de33fc625725d199629ed074d6278504deb23deb |
|
24-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: rename sd_bus_open_system_container() to sd_bus_open_system_machine()
Pretty much everywhere else we use the generic term "machine" when
referring to containers in API, so let's do though in sd-bus too. In
particular, since the concept of a "container" exists in sd-bus too, but
as part of the marshalling system. |
2ebcf936702e8e511098711b4add885372360018 |
|
11-Dec-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
localectl,man: make it obvious that set-*-keymaps sets both keymaps
https://bugs.freedesktop.org/show_bug.cgi?id=85411 |
4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4f |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: another round of simplifications
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno
+ return simplifications". |
56f64d95763a799ba4475daf44d8e9f72a1bd474 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful
value, so we might as well use log_*_errno to have ERRNO= logged.
Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/'
Plus some whitespace, linewrap, and indent adjustments. |
f647962d64e844689f3e2acfce6102fc47e76df2 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: yet more log_*_errno + return simplifications
Using:
find . -name '*.[ch]' | while read f; do perl -i.mmm -e \
'local $/;
local $_=<>;
s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg;
print;'
$f
done
And a couple of manual whitespace fixups. |
ff49bc3212cb07d850dcfd59940539773a0be26f |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: drop unnecessary trailing \n in log_*() calls |
da927ba997d68401563b927f92e6e40e021a8e5c |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values. |
0a1beeb64207eaa88ab9236787b1cbc2f704ae14 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'
Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno(). |
31cf921abbeafc9dae2d5c777f3e2285e6f4c19d |
|
04-Nov-2014 |
Jan Synacek <jsynacek@redhat.com> |
localectl: fix localectl set-x11-keymap syntax description
This complements the fix in:
commit cd4c6fb12598435fe24431f1dd616f9582f0e3bd
Author: Jan Synacek <jsynacek@redhat.com>
Date: Mon Oct 20 12:43:39 2014 +0200
man: fix localectl set-x11-keymap syntax description |
b344bcbbfda8fbe14dadc5aa4b5dfb3ced6d76e2 |
|
02-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
localectl: always print warnings with log_warning() instead of printf()
They really should got to stderr, not stdout. |
63229aa1abdb98aa69fda9819ed2f40c8082762b |
|
02-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
localectl: count locale variables from 0, instead of VARIABLE_LANG
That way the we make our code safe regarding reordering of the variables
in the enum. |
a34286684ebb78dd3db0d7f34feb2c121c9d00cc |
|
25-Sep-2014 |
Michal Sekletar <msekleta@redhat.com> |
localectl: print warning when there are options given on kernel cmdline |
d5099efc47d4e6ac60816b5381a5f607ab03f06e |
|
15-Sep-2014 |
Michal Schmidt <mschmidt@redhat.com> |
hashmap: introduce hash_ops to make struct Hashmap smaller
It is redundant to store 'hash' and 'compare' function pointers in
struct Hashmap separately. The functions always comprise a pair.
Store a single pointer to struct hash_ops instead.
systemd keeps hundreds of hashmaps, so this saves a little bit of
memory. |
249968612f16a71df909d6e73785c18a9ff36a65 |
|
04-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
bus: always explicitly close bus from main programs
Since b5eca3a2059f9399d1dc52cbcf9698674c4b1cf0 we don't attempt to GC
busses anymore when unsent messages remain that keep their reference,
when they otherwise are not referenced anymore. This means that if we
explicitly want connections to go away, we need to close them.
With this change we will no do so explicitly wherver we connect to the
bus from a main program (and thus know when the bus connection should go
away), or when we create a private bus connection, that really should go
away after our use.
This fixes connection leaks in the NSS and PAM modules. |
601185b43da638b1c74153deae01dbd518680889 |
|
04-Aug-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Unify parse_argv style
getopt is usually good at printing out a nice error message when
commandline options are invalid. It distinguishes between an unknown
option and a known option with a missing arg. It is better to let it
do its job and not use opterr=0 unless we actually want to suppress
messages. So remove opterr=0 in the few places where it wasn't really
useful.
When an error in options is encountered, we should not print a lengthy
help() and overwhelm the user, when we know precisely what is wrong
with the commandline. In addition, since help() prints to stdout, it
should not be used except when requested with -h or --help.
Also, simplify things here and there. |
7568345034f2890af745747783c5abfbf6eccf0f |
|
07-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
shared: make timezone and locale enumeration and validation generic
This way we can reuse it other code thatn just localectl/localed +
timedatectl/timedated. |
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. |
6046278f405b3ebaf84fcf17f6e834c4c4bd6a42 |
|
14-Feb-2014 |
Djalal Harouni <tixxdz@opendz.org> |
localectl: log error if bus_map_all_properties() fails |
2b6bf07dd23bb467099d213c97b3875c5e453491 |
|
07-Dec-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Get rid of our reimplementation of basename
The only problem is that libgen.h #defines basename to point to it's
own broken implementation instead of the GNU one. This can be fixed
by #undefining basename. |
0732ef7acf37473847992888bcb6446726d9d877 |
|
19-Nov-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
localed: match converted keymaps before legacy
Before, X11 keymap fr-pc105-oss would be converted to fr,
even though fr-oss exists. Now, if
/usr/lib/kbd/keymaps/xkb/<layout>[-<variant>].map[.gz] exists,
<layout>[-<variant>] will be used as the console keymap,
falling back to the legacy mappings otherwise.
% sudo localectl set-x11-keymap pl pc105
% localectl
System Locale: LANG=en_US.UTF-8
VC Keymap: pl (was pl2 before)
X11 Layout: pl
X11 Model: pc105
% sudo localectl set-x11-keymap fr pc105 oss
% localectl
System Locale: LANG=en_US.UTF-8
VC Keymap: fr-oss (was fr before)
X11 Layout: fr
X11 Model: pc105
X11 Variant: oss
% sudo localectl set-x11-keymap fr pc105
% localectl
System Locale: LANG=en_US.UTF-8
VC Keymap: fr
X11 Layout: fr
X11 Model: pc105
% sudo localectl set-x11-keymap gb
% localectl
System Locale: LANG=en_US.UTF-8
VC Keymap: gb (was uk before)
X11 Layout: gb |
d5d217eae1b3ba978c4ddd6a2ef2de4621329662 |
|
18-Nov-2013 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused variables |
c49b30a23583ff39daaa26696bcab478d2fee0bb |
|
12-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: rename sd_bus_send_with_reply_and_block() to sd_bus_call()
The call is one of the most important ones we expose, where we place
major emphasis on. We should make sure to give it a short, memorable
name. |
94676f3e9352cbf1f72e0a512ee0d2ed83ff676d |
|
08-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
localectl: port over to bus_log_create_error() |
a86a47ce1f63476631635fbcbc10af8877172114 |
|
07-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
clients: try to follow roughly the same order in --help texts for common options |
46e65dcc3a522b5e992e165b5e61d14254026859 |
|
07-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
polkit: don't spawn local client if we access a remote system |
eb9da376d76b48585b3b63b4f91903b54f7abd36 |
|
06-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
clients: unify how we invoke getopt_long()
Among other things this makes sure we always expose a --version command
and show it in the help texts. |
84f6181c2ac99a0514ca5e0c8fc8c8e284caf789 |
|
06-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
clients: various simplifications |
9f6eb1cd58f2ddf2eb6ba0e4de056e13d938af75 |
|
05-Nov-2013 |
Kay Sievers <kay@vrfy.org> |
bus: update bus_map_all_properties() |
ffc06c3513d9a0693c7f810d03b20705127ba55a |
|
02-Nov-2013 |
Kay Sievers <kay@vrfy.org> |
bus: use internal helper to read org.freedesktop.DBus.Properties::GetAll variables |
e1636421f46db6d06fbd028ef20a3113fa3e11f8 |
|
31-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
localectl: always print error message when an operation fails |
4b4bec19582c3ad2b7d25116f3c22c783274fead |
|
30-Oct-2013 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
localectl: remove unused 'P' arg |
4d7859d173282e16bb75254c2b4ec14a915ef30b |
|
30-Oct-2013 |
Kay Sievers <kay@vrfy.org> |
localectl: port to libsystemd-bus |
4a9e80b3b5d0d3c0cabac01c35db18d95f27c9c1 |
|
01-Aug-2013 |
Michał Górny < <mgorny@gentoo.org> |
Add /usr/share/keymaps to localectl supported locations.
This is the standard upstream location where kbd installs keymaps. |
7085053a437456ab87d726f3697002dd811fdf7a |
|
10-Jun-2013 |
Daniel Wallace <danielwallace@gtmanfred.com> |
Allow for the use of @ in remote host calls
Without this you have to use %40 with the -H flag because dbus doesn't
like the @ sign being unescaped. |
546158bc6f46f8004cc11e81d19d223e0da56730 |
|
23-May-2013 |
Jan Janssen <medhefgo@web.de> |
Fix --no-ask-password
POSIX_ME_HARDER mode is disabled for localectl. It doesn't
make much sense in case of localectl, and there's little reason
for localectl to behave specially. |
2927b326ccf67236e148444679f582ea1437ef5a |
|
21-May-2013 |
Jan Janssen <medhefgo@web.de> |
man: Document missing options |
ef42202ac8ed27e7ff1fc90ef8bc2590046dff25 |
|
24-Apr-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Add set_consume which always takes ownership
Freeing in error path is the common pattern with set_put(). |
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 |
c62e11ce3966c55d23520b9f0785c7e839cf7f37 |
|
15-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
localectl: read X11 keymaps from the correct file
As reported by Sergey Udaltsov. |
0affed79d2e30013f07cb94e6f07e3fcb81c02fa |
|
10-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
localctl: skip locale entries with non-UTF8 names
glibc should place these in the locale archive. For now, let's just skip
them from our output, since they are aliases anyway.
https://bugs.freedesktop.org/show_bug.cgi?id=63389 |
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. |
50cfc579280fb42569488079bd2e249e32a27df2 |
|
05-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
localectl: add support for listing X11 keymap information |
8333c77edf8fd1654cd96f3f6ee0f078dd64b58b |
|
29-Mar-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Always use errno > 0 to help gcc
gcc thinks that errno might be negative, and functions could return
something positive on error (-errno). Should not matter in practice,
but makes an -O4 build much quieter. |
1b12a7b5896f94bdf33b3a6661ebabd761ea6adc |
|
07-Mar-2013 |
Harald Hoyer <harald@redhat.com> |
pager: introduce "jump to end" option
$ journalctl -be
is what you want :)
https://bugzilla.redhat.com/show_bug.cgi?id=867841 |
82c1d8f4eb74ddd9be2c9b9b56d9dc564c599eff |
|
12-Feb-2013 |
Lennart Poettering <lennart@poettering.net> |
localectl: fix --help text
https://bugs.freedesktop.org/show_bug.cgi?id=60595 |
7c2d80944afb4196f2eff614e8da1450dffcbeaa |
|
07-Feb-2013 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
strv: add strv_print
Clearer, and spares the temp variable. |
bac3c8eefe23a820caac930d41629cebafbfc7b2 |
|
07-Jan-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
localectl: use automatic cleanup
set_freep() is added to automatize set_free(). |
17d33cecaa762f7e43200307328af5e9135e2091 |
|
07-Jan-2013 |
Giovanni Campagna <scampa.giovanni@gmail.com> |
localectl: support systems without locale-archive
Not all systems ships with locales inside /usr/lib/locale-archive, some
prefer to have locale data as individual subdirectories of /usr/lib/locale.
(A notable example of this is OpenEmbeddded, and OSes deriving from it
like gnome-ostree).
Given that glibc supports both ways, localectl should too. |
bc2708414babc5c99bb8000e63c84e87606cc15d |
|
04-Jan-2013 |
Lennart Poettering <lennart@poettering.net> |
build-sys: drop all distribution specfic checks
Yay, we now have a completely generic systemd. No distribution specific checks anymore! |
6b2b6f30e38d67b032d6bdc6b47ae05e143e96c5 |
|
12-Dec-2012 |
Michal Schmidt <mschmidt@redhat.com> |
localectl: fix dbus call arguments in set_x11_keymap
Fixes an assertion failure in the dbus lib.
https://bugzilla.redhat.com/show_bug.cgi?id=882212 |
a9cdc94f7ff40f22a3cf9472f612a80730a1b010 |
|
12-Nov-2012 |
Dave Reisner <dreisner@archlinux.org> |
enable localization for common *ctl commands |
7ca7021a9e0c443d40d0af5e9a7e1962d8032229 |
|
28-Oct-2012 |
Michal Sekletar <msekleta@redhat.com> |
localectl: fix memleak, use _cleanup_strv_free_
l might contain zero strings, however there is still memory
allocated for NULL terminator, use _cleanup_strv_free_ instead to
prevent tiny leak in such case. |
2f7a4867babd3fd382e5495f21724358f30fa67d |
|
28-Oct-2012 |
Michal Sekletar <msekleta@redhat.com> |
localectl: fix memleak, jump to finish before returning |
2087a7aff26ea5d1bc2c7c29add3275328f36baa |
|
19-Oct-2012 |
Lennart Poettering <lennart@poettering.net> |
locale: add client tool localectl similar to hostnamectl/timedatectl |