Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
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.
|
|
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
|
|
|
|
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.
|
|
|
|
|
|
|
|
Among other things this makes sure we always expose a --version command
and show it in the help texts.
|
|
|
|
|
|
variables
|
|
|
|
|
|
|
|
This is the standard upstream location where kbd installs keymaps.
|
|
Without this you have to use %40 with the -H flag because dbus doesn't
like the @ sign being unescaped.
|
|
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.
|
|
|
|
Freeing in error path is the common pattern with set_put().
|
|
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
|
|
As reported by Sergey Udaltsov.
|
|
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
|
|
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.
|
|
|
|
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.
|
|
$ journalctl -be
is what you want :)
https://bugzilla.redhat.com/show_bug.cgi?id=867841
|
|
https://bugs.freedesktop.org/show_bug.cgi?id=60595
|
|
Clearer, and spares the temp variable.
|
|
set_freep() is added to automatize set_free().
|
|
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.
|
|
Yay, we now have a completely generic systemd. No distribution specific checks anymore!
|
|
Fixes an assertion failure in the dbus lib.
https://bugzilla.redhat.com/show_bug.cgi?id=882212
|
|
|
|
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.
|
|
|
|
|