chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] update the man pages and correct Usage: hints
[elogind.git]
/
namedev_parse.c
diff --git
a/namedev_parse.c
b/namedev_parse.c
index 73828a83b2f864d436c222d1085779db74bacd78..d39141bfc7536d1718f271502a887014eabbd12d 100644
(file)
--- a/
namedev_parse.c
+++ b/
namedev_parse.c
@@
-36,7
+36,7
@@
#include <errno.h>
#include "udev.h"
#include <errno.h>
#include "udev.h"
-#include "udev_
lib
.h"
+#include "udev_
utils
.h"
#include "logging.h"
#include "namedev.h"
#include "logging.h"
#include "namedev.h"
@@
-113,7
+113,7
@@
void dump_perm_dev_list(void)
dump_perm_dev(dev);
}
dump_perm_dev(dev);
}
-/* extract possible KEY{attr}
or KEY_attr
*/
+/* extract possible KEY{attr} */
static char *get_key_attribute(char *str)
{
char *pos;
static char *get_key_attribute(char *str)
{
char *pos;
@@
-132,13
+132,6
@@
static char *get_key_attribute(char *str)
return attr;
}
return attr;
}
- attr = strchr(str, '_');
- if (attr != NULL) {
- attr++;
- dbg("attribute='%s'", attr);
- return attr;
- }
-
return NULL;
}
return NULL;
}
@@
-258,6
+251,18
@@
static int namedev_parse_rules(const char *filename, void *data)
continue;
}
continue;
}
+ if (strcasecmp(temp2, FIELD_SUBSYSTEM) == 0) {
+ strfieldcpy(dev.subsystem, temp3);
+ valid = 1;
+ continue;
+ }
+
+ if (strcasecmp(temp2, FIELD_DRIVER) == 0) {
+ strfieldcpy(dev.driver, temp3);
+ valid = 1;
+ continue;
+ }
+
if (strcasecmp(temp2, FIELD_PROGRAM) == 0) {
program_given = 1;
strfieldcpy(dev.program, temp3);
if (strcasecmp(temp2, FIELD_PROGRAM) == 0) {
program_given = 1;
strfieldcpy(dev.program, temp3);
@@
-273,10
+278,16
@@
static int namedev_parse_rules(const char *filename, void *data)
if (strncasecmp(temp2, FIELD_NAME, sizeof(FIELD_NAME)-1) == 0) {
attr = get_key_attribute(temp2 + sizeof(FIELD_NAME)-1);
if (strncasecmp(temp2, FIELD_NAME, sizeof(FIELD_NAME)-1) == 0) {
attr = get_key_attribute(temp2 + sizeof(FIELD_NAME)-1);
- if (attr != NULL && strcasecmp(attr, ATTR_PARTITIONS) == 0) {
+ if (attr != NULL) {
+ if (strstr(attr, ATTR_PARTITIONS) != NULL) {
dbg_parse("creation of partition nodes requested");
dev.partitions = PARTITIONS_COUNT;
}
dbg_parse("creation of partition nodes requested");
dev.partitions = PARTITIONS_COUNT;
}
+ if (strstr(attr, ATTR_IGNORE_REMOVE) != NULL) {
+ dbg_parse("remove event should be ignored");
+ dev.ignore_remove = 1;
+ }
+ }
strfieldcpy(dev.name, temp3);
valid = 1;
continue;
strfieldcpy(dev.name, temp3);
valid = 1;
continue;