This commit is contained in:
Daniel Eklöf 2018-12-16 17:08:38 +01:00
parent fa3c17aa4a
commit a9681dd19c
2 changed files with 3 additions and 2 deletions

View file

@ -210,8 +210,9 @@ run(struct module_run_context *ctx)
if (fds[1].revents & POLLIN) { if (fds[1].revents & POLLIN) {
struct udev_device *dev = udev_monitor_receive_device(mon); struct udev_device *dev = udev_monitor_receive_device(mon);
bool is_us = strcmp(udev_device_get_sysname(dev), m->battery) == 0; const char *sysname = udev_device_get_sysname(dev);
bool is_us = strcmp(sysname, m->battery) == 0;
udev_device_unref(dev); udev_device_unref(dev);
if (!is_us) if (!is_us)

View file

@ -40,7 +40,7 @@ instantiate(const struct particle *particle, const struct tag_set *tags)
double progress = (double)value / (max - min); double progress = (double)value / (max - min);
size_t idx = progress * ramp->count; size_t idx = progress * ramp->count;
printf("value: %lu, min: %lu, max: %lu, progress: %f, idx: %zu\n", printf("ramp: value: %lu, min: %lu, max: %lu, progress: %f, idx: %zu\n",
value, min, max, progress, idx); value, min, max, progress, idx);
assert(idx >= 0 && idx < ramp->count); assert(idx >= 0 && idx < ramp->count);