- char line[255];
- char *temp;
- char *temp2;
- FILE *fd;
- int retval = 0;
- struct perm_device dev;
-
- fd = fopen(udev_permissions_filename, "r");
- if (fd != NULL) {
- dbg("reading '%s' as permissions file", udev_permissions_filename);
- } else {
- dbg("can't open '%s' as permissions file", udev_permissions_filename);
- return -ENODEV;
- }
-
- /* loop through the whole file */
- while (1) {
- temp = fgets(line, sizeof(line), fd);
- if (temp == NULL)
- break;
-
- dbg_parse("read '%s'", temp);
-
- /* eat the whitespace at the beginning of the line */
- while (isspace(*temp))
- ++temp;
-
- /* empty line? */
- if ((*temp == '\0') || (*temp == '\n'))
- continue;
-
- /* see if this is a comment */
- if (*temp == COMMENT_CHARACTER)
- continue;