chiark / gitweb /
[PATCH] add IGNORE rule type
[elogind.git] / namedev_parse.c
index de29057..5b5a5b3 100644 (file)
@@ -103,13 +103,17 @@ void dump_config_dev(struct config_device *dev)
                          dev->name, dev->bus, dev->place);
                break;
        case REPLACE:
-               dbg_parse("REPLACE name=%s, kernel_name=%s",
+               dbg_parse("REPLACE name='%s', kernel_name='%s'",
                          dev->name, dev->kernel_name);
                break;
        case CALLOUT:
                dbg_parse("CALLOUT name='%s', bus='%s', program='%s', id='%s'",
                          dev->name, dev->bus, dev->exec_program, dev->id);
                break;
+       case IGNORE:
+               dbg_parse("IGNORE name='%s', kernel_name='%s'",
+                         dev->name, dev->kernel_name);
+               break;
        default:
                dbg_parse("unknown type of method");
        }
@@ -209,6 +213,11 @@ int namedev_init_rules(void)
                        goto keys;
                }
 
+               if (strcasecmp(temp2, TYPE_IGNORE) == 0) {
+                       dev.type = IGNORE;
+                       goto keys;
+               }
+
                dbg_parse("unknown type of method '%s'", temp2);
                goto error;
 keys:
@@ -323,6 +332,12 @@ keys:
                            (*dev.exec_program == '\0'))
                                goto error;
                        break;
+               case IGNORE:
+                       dbg_parse(TYPE_IGNORE "name='%s', kernel_name='%s'",
+                                 dev.name, dev.kernel_name);
+                       if ((*dev.kernel_name == '\0'))
+                               goto error;
+                       break;
                default:
                        dbg_parse("unknown type of method");
                        goto error;