mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-06-16 08:15:40 +02:00
modules: handle udev_monitor_receive_device() returning NULL
Closes #109
This commit is contained in:
parent
0f389435ca
commit
1bcf116859
4 changed files with 13 additions and 3 deletions
|
@ -437,8 +437,10 @@ run(struct module *mod)
|
|||
|
||||
if (fds[1].revents & POLLIN) {
|
||||
struct udev_device *dev = udev_monitor_receive_device(mon);
|
||||
const char *sysname = udev_device_get_sysname(dev);
|
||||
if (dev == NULL)
|
||||
continue;
|
||||
|
||||
const char *sysname = udev_device_get_sysname(dev);
|
||||
bool is_us = sysname != NULL && strcmp(sysname, m->battery) == 0;
|
||||
udev_device_unref(dev);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue