[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.
This commit is contained in:
greg@kroah.com 2004-01-12 23:08:43 -08:00 committed by Greg KH
parent ac28b86d63
commit 851cd18d81
1 changed files with 7 additions and 3 deletions

View File

@ -21,8 +21,10 @@
* *
*/ */
/* define this to enable parsing debugging */ #ifdef DEBUG
/* define this to enable parsing debugging also */
/* #define DEBUG_PARSER */ /* #define DEBUG_PARSER */
#endif
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
@ -230,7 +232,9 @@ int namedev_init_rules(void)
continue; 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 */ /* simple plausibility check for given keys */
@ -250,7 +254,7 @@ int namedev_init_rules(void)
dbg("add_config_dev returned with error %d", retval); dbg("add_config_dev returned with error %d", retval);
continue; continue;
error: error:
dbg("%s:%d:%Zd: parse error, rule skipped", dbg("%s:%d:%d: parse error, rule skipped",
udev_rules_filename, lineno, temp - line); udev_rules_filename, lineno, temp - line);
} }
} }