mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-04-25 14:50:10 +03:00
[PATCH] add a blacklist of class devices we do not want to look at.
Thanks to Kay for the original patch, and the idea.
This commit is contained in:
parent
e9a8c2e432
commit
8eb38ef882
18
udev.c
18
udev.c
@ -139,12 +139,20 @@ help:
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *subsystem_blacklist[] = {
|
||||||
|
"net",
|
||||||
|
"scsi_host",
|
||||||
|
"scsi_device",
|
||||||
|
"",
|
||||||
|
};
|
||||||
|
|
||||||
static inline int udev_hotplug(int argc, char **argv)
|
static inline int udev_hotplug(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char *action;
|
char *action;
|
||||||
char *devpath;
|
char *devpath;
|
||||||
char *subsystem;
|
char *subsystem;
|
||||||
int retval = -EINVAL;
|
int retval = -EINVAL;
|
||||||
|
int i;
|
||||||
|
|
||||||
subsystem = argv[1];
|
subsystem = argv[1];
|
||||||
|
|
||||||
@ -162,11 +170,15 @@ static inline int udev_hotplug(int argc, char **argv)
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* but we don't care about net class devices */
|
/* skip blacklisted subsystems */
|
||||||
if (strcmp(subsystem, "net") == 0) {
|
i = 0;
|
||||||
dbg("don't care about net devices");
|
while (subsystem_blacklist[i][0] != '\0') {
|
||||||
|
if (strcmp(subsystem, subsystem_blacklist[i]) == 0) {
|
||||||
|
dbg("don't care about '%s' devices", subsystem);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
action = get_action();
|
action = get_action();
|
||||||
if (!action) {
|
if (!action) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user