summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgreg@kroah.com <greg@kroah.com>2004-01-12 23:08:43 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:13:15 -0700
commit851cd18d81f7bce79947a014f19a6cb97141311d (patch)
treeead59fa756dcddbe5b692e3cf9281a016d7ad730
parentac28b86d631f23b5df74dbeb33e76a2b3f5d88bb (diff)
[PATCH] Add some helpful messages if the user uses the older config file format
Also fail a rule that we can not parse, as we can easily create incorrect rules if we do not do this.
-rw-r--r--namedev_parse.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/namedev_parse.c b/namedev_parse.c
index 98e822dfef..0712c3b447 100644
--- a/namedev_parse.c
+++ b/namedev_parse.c
@@ -21,8 +21,10 @@
*
*/
-/* define this to enable parsing debugging */
+#ifdef DEBUG
+/* define this to enable parsing debugging also */
/* #define DEBUG_PARSER */
+#endif
#include <stddef.h>
#include <stdlib.h>
@@ -230,7 +232,9 @@ int namedev_init_rules(void)
continue;
}
- dbg_parse("unknown type of field '%s'", temp2);
+ dbg("unknown type of field '%s'", temp2);
+ dbg("You might be using a rules file in the old format, please fix.");
+ goto error;
}
/* simple plausibility check for given keys */
@@ -250,7 +254,7 @@ int namedev_init_rules(void)
dbg("add_config_dev returned with error %d", retval);
continue;
error:
- dbg("%s:%d:%Zd: parse error, rule skipped",
+ dbg("%s:%d:%d: parse error, rule skipped",
udev_rules_filename, lineno, temp - line);
}
}