Commit Graph

10 Commits

Author SHA1 Message Date
Anthony G. Basile
206d05759f test-libudev.c: remove deprecated functions. 2015-04-12 12:21:07 -04:00
Lennart Poettering
c597413eb3 udev: never bypass our own logging framework and call vsyslog() directly from udev tools
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-12 14:14:22 -04:00
Anthony G. Basile
e35ef44ebe test: use _cleanup_ attribute
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05 10:46:11 -04:00
Zbigniew Jędrzejewski-Szmek
d8808bc082 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.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05 08:38:32 -04:00
Kay Sievers
2500dbc810 udev: remove seqnum API and all assumptions about seqnums
The way the kernel namespaces have been implemented breaks assumptions
udev made regarding uevent sequence numbers. Creating devices in a
namespace "steals" uevents and its sequence numbers from the host. It
confuses the "udevadmin settle" logic, which might block until util a
timeout is reached, even when no uevent is pending.

Remove any assumptions about sequence numbers and deprecate libudev's
API exposing these numbers; none of that can reliably be used anymore
when namespaces are involved.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-04-24 15:40:08 -04:00
Greg KH
8fe0351586 use memzero(foo, length); for all memset(foo, 0, length); calls
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>
2014-02-02 07:15:23 -05:00
Anthony G. Basile
0df9dcf039 test/test-libudev.c: bring into line with upstream
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-01-09 17:53:17 -05:00
Thomas Hindoe Paaboel Andersen
079a9c8229 Add more _printf_'s for format-nonliterals
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>
2014-01-09 16:42:19 -05:00
Anthony G. Basile
15b5151867 test/test-libudev.c: minor change to match upstream 2013-09-10 05:36:39 -04:00
Anthony G. Basile
73e31d7ae7 Fix paths: test/udev-test.pl now works under sudo make distcheck
We move the test-udev.c and test-libudev.c from src/test to test.
This corrects the a problem with hard coded relative paths finding
the test/test/sys directory created by test/udev-test.pl.

This commit draws heavily from nvinson patch in

 https://github.com/gentoo/eudev/pull/20

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-11-24 23:47:06 -05:00