TK_A_IGNORE_DEVICE,
TK_A_STRING_ESCAPE_NONE,
TK_A_STRING_ESCAPE_REPLACE,
- TK_A_INOTIFY_WATCH,
+ TK_A_INOTIFY_WATCH, /* int */
TK_A_NUM_FAKE_PART, /* int */
TK_A_DEVLINK_PRIO, /* int */
TK_A_OWNER, /* val */
union {
unsigned int attr_off;
int ignore_error;
- int i;
unsigned int rule_goto;
mode_t mode;
uid_t uid;
int num_fake_part;
int devlink_prio;
int event_timeout;
+ int watch;
};
} key;
};
case TK_A_IGNORE_DEVICE:
case TK_A_STRING_ESCAPE_NONE:
case TK_A_STRING_ESCAPE_REPLACE:
- case TK_A_INOTIFY_WATCH:
case TK_A_LAST_RULE:
case TK_A_IGNORE_REMOVE:
dbg(rules->udev, "%s\n", token_str(type));
dbg(rules->udev, "%s %s '%s'(%s) %#o\n",
token_str(type), operation_str(op), value, string_glob_str(glob), token->key.mode);
break;
+ case TK_A_INOTIFY_WATCH:
+ dbg(rules->udev, "%s %u\n", token_str(type), token->key.i);
+ break;
case TK_A_NUM_FAKE_PART:
dbg(rules->udev, "%s %u\n", token_str(type), token->key.num_fake_part);
break;
case TK_A_IGNORE_DEVICE:
case TK_A_STRING_ESCAPE_NONE:
case TK_A_STRING_ESCAPE_REPLACE:
- case TK_A_INOTIFY_WATCH:
case TK_A_IGNORE_REMOVE:
case TK_A_LAST_RULE:
break;
token->key.value_off = add_string(rule_tmp->rules, value);
token->key.ignore_error = *(int *)data;
break;
+ case TK_A_INOTIFY_WATCH:
case TK_A_NUM_FAKE_PART:
- token->key.num_fake_part = *(int *)data;
- break;
case TK_A_DEVLINK_PRIO:
token->key.devlink_prio = *(int *)data;
break;
rule_add_key(&rule_tmp, TK_A_NUM_FAKE_PART, 0, NULL, &num);
dbg(rules->udev, "creation of partition nodes requested\n");
}
- pos = strstr(value, "watch");
+ pos = strstr(value, "nowatch");
if (pos != NULL) {
- rule_add_key(&rule_tmp, TK_A_INOTIFY_WATCH, 0, NULL, NULL);
- dbg(rules->udev, "inotify watch of device requested\n");
+ const int off = 0;
+
+ rule_add_key(&rule_tmp, TK_A_INOTIFY_WATCH, 0, NULL, &off);
+ dbg(rules->udev, "inotify watch of device disabled\n");
+ } else {
+ pos = strstr(value, "watch");
+ if (pos != NULL) {
+ const int on = 1;
+
+ rule_add_key(&rule_tmp, TK_A_INOTIFY_WATCH, 0, NULL, &on);
+ dbg(rules->udev, "inotify watch of device requested\n");
+ }
}
continue;
}
udev_device_set_num_fake_partitions(event->dev, cur->key.num_fake_part);
break;
case TK_A_INOTIFY_WATCH:
- event->inotify_watch = 1;
+ event->inotify_watch = cur->key.watch;
break;
case TK_A_DEVLINK_PRIO:
udev_device_set_devlink_priority(event->dev, cur->key.devlink_prio);