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;