ALL_DIRECT_VARS(V_PRINT)
}
+ if (this_type == -1) {
+ /* some kernels don't seem to provide TYPE in the uevent
+ * guess the type from whether we see "present" or "online" */
+ if (this_online >= 0 && this_present == -1) this_type = TYPE_MAINS;
+ if (this_online == -1 && this_present >= 0) this_type = TYPE_BATTERY;
+ if (debug)
+ printf(" type absent from uevent %6s guessed %12s %"PRId64"\n",
+ "", "", this_type);
+ }
+
int needsfields_MAINS = this_type == TYPE_MAINS;
int needsfields_BATTERY = this_type == TYPE_BATTERY;
int needsfields_BOTH = 1;
+chiark-utils (4.2.1~~iwj) unstable; urgency=low
+
+ * Make xbatmon-simple tolerate the lack of "type" in power supply uevent
+ fields, by guessing the type from the presence or absence of "present"
+ (which appears for batteries) and "online" (which appears for mains).
+ Closes: #689134.
+
+ -- Ian Jackson <ijackson@chiark.greenend.org.uk> Sat, 29 Sep 2012 13:47:21 +0100
+
chiark-utils (4.2.0) unstable; urgency=low
* Rename `xacpi-simple' to `xbatmon-simple':