Systemd/src/udev
Lennart Poettering 38a03f06a7 sd-event: make sure sd_event_now() cannot fail
Previously, if the event loop never ran before sd_event_now() would
fail. With this change it will instead fall back to invoking now(). This
way, the function cannot fail anymore, except for programming error when
invoking it with wrong parameters.

This takes into account the fact that many callers did not handle the
error condition correctly, and if the callers did, then they kept simply
invoking now() as fall back on their own. Hence let's shorten the code
using this call, and make things more robust, and let's just fall back
to now() internally.

Whether now() is used or the cache timestamp may still be detected via
the return value of sd_event_now(). If > 0 is returned, then the fall
back to now() was used, if == 0 is returned, then the cached value was
returned.

This patch also simplifies many of the invocations of sd_event_now():
the manual fall back to now() can be removed. Also, in cases where the
call is invoked withing void functions we can now protect the invocation
via assert_se(), acknowledging the fact that the call cannot fail
anymore except for programming errors with the parameters.

This change is inspired by #841.
2015-08-03 17:34:49 +02:00
..
ata_id ata_id: remove unused union member 2015-07-25 00:14:13 +02:00
cdrom_id shared: add random-util.[ch] 2015-04-11 00:11:13 +02:00
collect remove unused includes 2015-02-23 23:53:42 +01:00
mtd_probe build-sys: add one more Makefile symlink 2015-03-09 18:02:23 +01:00
net sd-netlink: rename from sd-rtnl 2015-06-13 19:52:54 +02:00
scsi_id shared: add random-util.[ch] 2015-04-11 00:11:13 +02:00
v4l_id v4l_id: use standard option parsing loop 2015-03-07 13:54:32 -05:00
.gitignore build-sys: generate CLEANFILES from EXTRA_DIST 2015-03-04 22:47:19 -05:00
.vimrc
Makefile build-sys: add stub makefiles to all subdirs to ease development with emacs 2012-04-13 21:37:59 +02:00
udev-builtin-blkid.c udev: downgrade a few warnings to debug messages 2015-04-14 15:53:33 +02:00
udev-builtin-btrfs.c remove unused includes 2015-02-23 23:53:42 +01:00
udev-builtin-hwdb.c tree-wide: do not use _cleanup_free_ on const pointers 2015-07-24 13:52:30 +02:00
udev-builtin-input_id.c udev: input_id - use ABS_MT_SLOT{-1} to exclude non touch screen devices 2015-06-03 08:31:02 +10:00
udev-builtin-keyboard.c udev: add some asserts 2015-06-02 18:12:47 +02:00
udev-builtin-kmod.c remove unused includes 2015-02-23 23:53:42 +01:00
udev-builtin-net_id.c udev: add some asserts 2015-06-02 18:12:47 +02:00
udev-builtin-net_setup_link.c udevadm,..: make --help output of udev tools more like the output of the various other tools 2015-01-05 13:19:55 +01:00
udev-builtin-path_id.c tree-wide: introduce mfree() 2015-07-31 19:56:38 +02:00
udev-builtin-uaccess.c remove unused includes 2015-02-23 23:53:42 +01:00
udev-builtin-usb_id.c udev: add some asserts 2015-06-02 18:12:47 +02:00
udev-builtin.c udev: Fix udev_builtin_run_once() 2015-07-28 14:38:31 +02:00
udev-ctrl.c udev-ctrl: make _unref() always return NULL 2015-05-15 23:36:35 +02:00
udev-event.c udev: event - simplify udev_event_spawn() logic 2015-06-29 19:51:04 +02:00
udev-node.c shared: add formats-util.h 2015-04-10 23:54:48 +02:00
udev-rules.c tree-wide: introduce mfree() 2015-07-31 19:56:38 +02:00
udev-watch.c remove unused includes 2015-02-23 23:53:42 +01:00
udev.conf man: add udev.conf(5) 2014-07-31 08:56:03 -04:00
udev.h udev: event - simplify udev_event_spawn() logic 2015-06-29 19:51:04 +02:00
udev.pc.in udev.pc: install udev files to /lib/udev rather than /lib/systemd 2012-05-27 15:24:20 +02:00
udevadm-control.c remove unused includes 2015-02-23 23:53:42 +01:00
udevadm-hwdb.c Revert "hwdb: actually search /run/udev/hwdb.d" 2015-06-09 11:26:06 +02:00
udevadm-info.c udevadm: enclose invocation of unlinkat() with a (void) cast 2015-04-21 17:43:55 +02:00
udevadm-monitor.c shared: add formats-util.h 2015-04-10 23:54:48 +02:00
udevadm-settle.c udev: Fix ping timeout when settle timeout is 0 2015-04-22 19:16:58 +02:00
udevadm-test-builtin.c remove unused includes 2015-02-23 23:53:42 +01:00
udevadm-test.c udevd: simplify signal mask handling 2015-06-03 01:41:34 +02:00
udevadm-trigger.c udevadm: trigger - check return values 2015-06-23 17:20:12 +02:00
udevadm-util.c util: rework strappenda(), and rename it strjoina() 2015-02-03 02:05:59 +01:00
udevadm-util.h #pragma once here and there 2015-01-23 09:30:44 -05:00
udevadm.c remove unused includes 2015-02-23 23:53:42 +01:00
udevd.c sd-event: make sure sd_event_now() cannot fail 2015-08-03 17:34:49 +02:00