Age | Commit message (Collapse) | Author |
|
GCC optimizes strlen("string constant") to a constant, even with -O0.
Thus, replace patterns like sizeof("string constant")-1 with
strlen("string constant") where possible, for clarity. In particular,
for expressions intended to add up the lengths of components going into
a string, this often makes it clearer that the expression counts the
trailing '\0' exactly once, by putting the +1 for the '\0' at the end of
the expression, rather than hidden in a sizeof in the middle of the
expression.
|
|
|
|
|
|
As pointed-out by clang -Wunreachable-code.
No behaviour changes.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
If -flto is used then gcc will generate a lot more warnings than before,
among them a number of use-without-initialization warnings. Most of them
without are false positives, but let's make them go away, because it
doesn't really matter.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Resolve spotted issues related to missing or extraneous commas, dashes.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Use PID_FMT/USEC_FMT/... in more places.
Also update logind error messages to print the full path to a file that
failed. This should make debugging easier for people who do not know
off the top of their head where logind stores it state.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
In trying to track down a stupid linker bug, I noticed a bunch of
memset() calls that should be using memzero() to make it more "obvious"
that the options are correct (i.e. 0 is not the length, but the data to
set). So fix up all current calls to memset(foo, 0, length) to
memzero(foo, length).
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
The nodes usually do not exist, so handle the next item instead of
skipping the entire rule.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
while theoretically a nice interface, qsort_r on GLIBC was
implemented with a prototype that shuffles the argument order
around when compared to the traditional BSD implementations,
yielding in 2 separate incompatible implementations.
even worse, the arguments are all of pointer type so one would
not even notice that the order is wrong and so this would yield
in crashes or silent memory corruption.
thus musl does not implement it, because configure scripts would
check for its existance and use it unconditionally, even when
assuming the BSD version.
a more portable solution is to use TLS via __thread, which any
modern GCC should provide. (even 3.4.6 on x86/x86_64 does so).
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
These commits were authored by
Zbigniew Jędrzejewski-Szmek
Tom Gundersen
Kay Sievers
Lennart Poettering
Shawn Landden
Daniel Buch
Martin Pitt
Karel Zak
Yang Zhiyong
Note: udev_builtin_net_setup_link has *not* been imported. Also
still missing from udev-builtin is udev_builtin_uaccess.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
This matches the bcma support in the network device naming.
Eventually wa want to make sure ID_PATH is equivalent to ID_NET_NAME_PATH,
so we never need to match on the latter.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
I want to use this from a bulitin in a subsequent patch.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Since the invention of read-only memory, write-only memory has been
considered deprecated. Where appropriate, either make use of the
value, or avoid writing it, to make it clear that it is not used.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
bInterfaceSubClass == 5 is not a "floppy"; just identify the obsolete
QIC-157 interface as "generic".
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Always cache the results, and bypass low-level security calls when
the respective subsystem is not enabled.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Set some_transport = true to prevent scm devices from being ignored.
Suggested-by: Harald Hoyer <harald@redhat.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
https://bugs.archlinux.org/task/36950
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Clang is a bit more strict wrt format-nonliterals:
http://clang.llvm.org/docs/LanguageExtensions.html#format-string-checking
Adding these extra printf attributes also makes gcc able to find more
problems. E.g. this patch uncovers a format issue in udev-builtin-path_id.c
Some parts looked intetional about breaking the format-nonliteral check.
I added some supression for warnings there.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
|
|
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
The symlink destination should not include DESTDIR.
Signed-off-by: Michael Forney <mforney@mforney.org>
|
|
src/udev/udev-rules.c: In function 'add_rule':
src/udev/udev-rules.c:1078:33: warning: format '%lu' expects argument of type 'long unsigned int', but argument 8 has type 'int' [-Wformat=]
log_error("invalid key/value pair in file %s on line %u,"
^
|
|
systemd-udevd[6260]: invalid key/value pair in file /usr/lib/udev/rules.d/60-ffado.rules on line 46,starting at character 84 ('#')
|
|
A regression introduced when we moved to systemd's logging is that the only
way to adjust the log-level of the udev daemon is via the env var, kernel
commandline or the commandline.
This reintroduces support for specifying this in the configuration file.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
composed one
|
|
while theoretically a nice interface, qsort_r on GLIBC was
implemented with a prototype that shuffles the argument order
around when compared to the traditional BSD implementations,
yielding in 2 separate incompatible implementations.
even worse, the arguments are all of pointer type so one would
not even notice that the order is wrong and so this would yield
in crashes or silent memory corruption.
thus musl does not implement it, because configure scripts would
check for its existance and use it unconditionally, even when
assuming the BSD version.
a more portable solution is to use TLS via __thread, which any
modern GCC should provide. (even 3.4.6 on x86/x86_64 does so).
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
sys/poll.h is a legacy alias used by glibc.
according to POSIX #include <poll.h> is correct.
on GLIBC, the POSIX header includes sys/poll.h, so everything
continues working as it should.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
strndupa() allocates memory using alloca() which is dangerous and
non-conformant. Some libcs, like musl, deliberately do not implement
it. Instead we allocate a buffer on the stack which is cleaned up
on return.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
When a new network iface device is added, scan through the list of rules to see if its
kernel-assigned name is used as a target for another device. If so, and said target device
is not this device, rename it to a temporary interface name. Then rename the device in
accordance with any rename rules that may apply to this device, if applicable.
The temporary name assigned is the basename of the interface with a numeric compoment which is
close to the inverse of the numeric id (127 - id#). This should provide a more user-friendly
output than the old 'rename#' behaviour, when there is no final target name for the iface.
This proactive temporary rename will prevent cases where old-style rule-generator rules are used
and a target NAME= is set for one iface, assigning it to the iface name used by a second iface,
and that second iface has no rename rule to apply. The original rename code would be blocked
due to the conflict and time out when attempting to rename, leaving the interface assigned to the
temporary 'rename[id#]' name and/or failing to rename other ifaces in accordance with the existing
rules. This is a corner case that only occurrs when 75-persistent-net-generator.rules or the
write_net_rules script it 'IMPORTS' fails to generate a new rule and rename the interface and
there is no other interface-renaming rules that apply.
There may also be performance benefits to renaming ifaces early, but no benchmarks have been
run to confirm this.
Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
|
|
This reverts commit aa417a4d83999f6d7f092161d5c411b8cbce9977.
Preface: The kmod+tmpfiles static dev-node creation requires two commands to
be executed at runtime -- it is not something that will automatically occur
without a system's setup being explicitly designed or changed so that these
commands are executed.
Preface2: In order for the kmod+tmpfiles static dev-node creation to work
properly, that -must- be executed at startup before {systemd-,}udevd starts.
The reason for this is because udevd will only set permissions on those files
at startup, and so if udevd starts beforehand then these nodes will exist with
permissions that are (probably) too restrictive.
The function in udevd which creates static-nodes is non-fatal and only updates
mtime on the devnodes if they already exist. As such, if a system is configured
to execute kmod+tmpfiles to create static-nodes, because that must occur first,
eudev's udevd will not conflict. Also, if a system does not execute kmod+tmpfiles,
then eudev will still create the static devnodes, even if kmod-14 or higher is
installed.
There *may* be a conflict if kmod+tmpfiles is executed after udevd starts, but
as per "preface2" this is not a supported configuration.
Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
|
|
This address upstream commit edeb68c53f1cdc452016b4c8512586a70b1262e3
and https://bugs.gentoo.org/show_bug.cgi?id=477890. If eudev is
configured with --enable-libkmod then we check for kmod >= 14 and
ifdef out the code removed in the upstream commit. Otherwise we
retain it for modutils.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
This is upstream 84b6ad702e64db534f67ce32d4dd2fec00a16784
Based on a patch by Kay Sievers.
A tag is exported at boot as a symlinks to the device node in the folder
/run/udev/static_node-tags/<tagname>/, if the device node exists.
These tags are cleaned up by udevadm info --cleanup-db, but are otherwise
never removed.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
|