keventd: one condition emitter, one file reader, one clock

Three copies of read-first-line-from-a-file (sysfs_read_file, a
static sysfs_read, fgetline), two condition emitters symlinking the
same reconf marker (cond_emit, sys_cond), two seqnum-stable loops,
and five hand-rolled logit() prototypes, none with a printf
attribute, so no format string was ever checked.

Keep one of each: cond_emit() is exported and mkpaths its parents,
which also retires init_dev_condition_dir() and the sys/ directory
priming loop; logit() moves to keventd.h with the format attribute;
the stability test becomes seqnum_stable(), shared by the coldplug
gate and settle; kev_now_ms() serves dbus.c too.  rule_ctx_free()
and kev_seq_baseline() had one caller each in their own files, now
static.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-08-16 22:03:45 +02:00
1 parent 558c0f8c3b
commit 7eb32bc543
7 files changed
+83 -186

No files matched your search

-8
View File
@@ -38,9 +38,6 @@
#include "sysfs.h"
#include "udevdb.h"
/* Forward declaration from keventd.c */
void logit(int prio, const char *fmt, ...);
/*
* Compute the database file path for a device.
*
@@ -174,11 +171,6 @@ int udevdb_read(struct uevent *ev)
return udevdb_load(path, ev);
}
/*
* Read the parent device's properties into ev's env store, for
* IMPORT{parent} in the rules engine. The parent has no uevent to key
* from, so its device ID is composed from sysfs (see udevdb_path()).
*/
/*
* Read E: records for any devpath, keyed from its sysfs attributes:
* the device has no uevent in hand, so major:minor, ifindex, and