Lines Matching refs:event

1375 …c bool token_match_attr(UdevRules *rules, UdevRuleToken *token, sd_device *dev, UdevEvent *event) {  in token_match_attr()  argument
1384 assert(event); in token_match_attr()
1390 (void) udev_event_apply_format(event, name, nbuf, sizeof(nbuf), false, &truncated); in token_match_attr()
1402 … if (device_get_sysattr_value_maybe_from_netlink(dev, &event->rtnl, name, &value) < 0) in token_match_attr()
1544 UdevEvent *event, in udev_rule_apply_token_to_event() argument
1554 assert(event); in udev_rule_apply_token_to_event()
1601 return token_match_string(token, event->name); in udev_rule_apply_token_to_event()
1656 return token_match_attr(rules, token, dev, event); in udev_rule_apply_token_to_event()
1662 … (void) udev_event_apply_format(event, token->data, buf, sizeof(buf), false, &truncated); in udev_rule_apply_token_to_event()
1681 … (void) udev_event_apply_format(event, token->value, buf, sizeof(buf), false, &truncated); in udev_rule_apply_token_to_event()
1724 event->program_result = mfree(event->program_result); in udev_rule_apply_token_to_event()
1725 … (void) udev_event_apply_format(event, token->value, buf, sizeof(buf), false, &truncated); in udev_rule_apply_token_to_event()
1734 …r = udev_event_spawn(event, timeout_usec, timeout_signal, true, buf, result, sizeof(result), NULL); in udev_rule_apply_token_to_event()
1749 event->program_result = strdup(result); in udev_rule_apply_token_to_event()
1757 … (void) udev_event_apply_format(event, token->value, buf, sizeof(buf), false, &truncated); in udev_rule_apply_token_to_event()
1811 … (void) udev_event_apply_format(event, token->value, buf, sizeof(buf), false, &truncated); in udev_rule_apply_token_to_event()
1820 …r = udev_event_spawn(event, timeout_usec, timeout_signal, true, buf, result, sizeof result, &trunc… in udev_rule_apply_token_to_event()
1881 if (event->builtin_run & mask) { in udev_rule_apply_token_to_event()
1885 … return token->op == (event->builtin_ret & mask ? OP_NOMATCH : OP_MATCH); in udev_rule_apply_token_to_event()
1888 event->builtin_run |= mask; in udev_rule_apply_token_to_event()
1891 … (void) udev_event_apply_format(event, token->value, buf, sizeof(buf), false, &truncated); in udev_rule_apply_token_to_event()
1900 r = udev_builtin_run(dev, &event->rtnl, cmd, buf, false); in udev_rule_apply_token_to_event()
1904 event->builtin_ret |= mask; in udev_rule_apply_token_to_event()
1911 if (!event->dev_db_clone) in udev_rule_apply_token_to_event()
1913 r = sd_device_get_property_value(event->dev_db_clone, token->value, &val); in udev_rule_apply_token_to_event()
1948 … (void) udev_event_apply_format(event, token->value, buf, sizeof(buf), false, &truncated); in udev_rule_apply_token_to_event()
1963 return token_match_string(token, event->program_result); in udev_rule_apply_token_to_event()
1965 event->esc = ESCAPE_NONE; in udev_rule_apply_token_to_event()
1968 event->esc = ESCAPE_REPLACE; in udev_rule_apply_token_to_event()
1974 if (event->inotify_watch_final) in udev_rule_apply_token_to_event()
1977 event->inotify_watch_final = true; in udev_rule_apply_token_to_event()
1979 event->inotify_watch = token->data; in udev_rule_apply_token_to_event()
1988 level = event->default_log_level; in udev_rule_apply_token_to_event()
1992 if (level == LOG_DEBUG && !event->log_level_was_debug) { in udev_rule_apply_token_to_event()
1995 event->log_level_was_debug = true; in udev_rule_apply_token_to_event()
2005 if (event->owner_final) in udev_rule_apply_token_to_event()
2008 event->owner_final = true; in udev_rule_apply_token_to_event()
2010 … (void) udev_event_apply_format(event, token->value, owner, sizeof(owner), false, &truncated); in udev_rule_apply_token_to_event()
2017 r = get_user_creds(&ow, &event->uid, NULL, NULL, NULL, USER_CREDS_ALLOW_MISSING); in udev_rule_apply_token_to_event()
2021 log_rule_debug(dev, rules, "OWNER %s(%u)", owner, event->uid); in udev_rule_apply_token_to_event()
2029 if (event->group_final) in udev_rule_apply_token_to_event()
2032 event->group_final = true; in udev_rule_apply_token_to_event()
2034 … (void) udev_event_apply_format(event, token->value, group, sizeof(group), false, &truncated); in udev_rule_apply_token_to_event()
2041 r = get_group_creds(&gr, &event->gid, USER_CREDS_ALLOW_MISSING); in udev_rule_apply_token_to_event()
2045 log_rule_debug(dev, rules, "GROUP %s(%u)", group, event->gid); in udev_rule_apply_token_to_event()
2052 if (event->mode_final) in udev_rule_apply_token_to_event()
2055 event->mode_final = true; in udev_rule_apply_token_to_event()
2057 …(void) udev_event_apply_format(event, token->value, mode_str, sizeof(mode_str), false, &truncated); in udev_rule_apply_token_to_event()
2064 r = parse_mode(mode_str, &event->mode); in udev_rule_apply_token_to_event()
2068 log_rule_debug(dev, rules, "MODE %#o", event->mode); in udev_rule_apply_token_to_event()
2072 if (event->owner_final) in udev_rule_apply_token_to_event()
2075 event->owner_final = true; in udev_rule_apply_token_to_event()
2078 event->uid = PTR_TO_UID(token->data); in udev_rule_apply_token_to_event()
2079 log_rule_debug(dev, rules, "OWNER %u", event->uid); in udev_rule_apply_token_to_event()
2082 if (event->group_final) in udev_rule_apply_token_to_event()
2085 event->group_final = true; in udev_rule_apply_token_to_event()
2088 event->gid = PTR_TO_GID(token->data); in udev_rule_apply_token_to_event()
2089 log_rule_debug(dev, rules, "GROUP %u", event->gid); in udev_rule_apply_token_to_event()
2092 if (event->mode_final) in udev_rule_apply_token_to_event()
2095 event->mode_final = true; in udev_rule_apply_token_to_event()
2098 event->mode = PTR_TO_MODE(token->data); in udev_rule_apply_token_to_event()
2099 log_rule_debug(dev, rules, "MODE %#o", event->mode); in udev_rule_apply_token_to_event()
2110 …(void) udev_event_apply_format(event, token->value, label_str, sizeof(label_str), false, &truncate… in udev_rule_apply_token_to_event()
2125 ordered_hashmap_clear_free_free(event->seclabel_list); in udev_rule_apply_token_to_event()
2127 r = ordered_hashmap_ensure_put(&event->seclabel_list, NULL, name, label); in udev_rule_apply_token_to_event()
2164 (void) udev_event_apply_format(event, token->value, p, l, false, &truncated); in udev_rule_apply_token_to_event()
2171 if (event->esc == ESCAPE_REPLACE) { in udev_rule_apply_token_to_event()
2187 … (void) udev_event_apply_format(event, token->value, buf, sizeof(buf), false, &truncated); in udev_rule_apply_token_to_event()
2216 if (event->name_final) in udev_rule_apply_token_to_event()
2219 event->name_final = true; in udev_rule_apply_token_to_event()
2228 … (void) udev_event_apply_format(event, token->value, buf, sizeof(buf), false, &truncated); in udev_rule_apply_token_to_event()
2235 if (IN_SET(event->esc, ESCAPE_UNSET, ESCAPE_REPLACE)) { in udev_rule_apply_token_to_event()
2244 r = free_and_strdup_warn(&event->name, buf); in udev_rule_apply_token_to_event()
2248 log_rule_debug(dev, rules, "NAME '%s'", event->name); in udev_rule_apply_token_to_event()
2256 if (event->devlink_final) in udev_rule_apply_token_to_event()
2261 event->devlink_final = true; in udev_rule_apply_token_to_event()
2266 …(void) udev_event_apply_format(event, token->value, buf, sizeof(buf), event->esc != ESCAPE_NONE, &… in udev_rule_apply_token_to_event()
2273 if (event->esc == ESCAPE_UNSET) in udev_rule_apply_token_to_event()
2275 else if (event->esc == ESCAPE_REPLACE) in udev_rule_apply_token_to_event()
2327 … (void) udev_event_apply_format(event, token->value, value, sizeof(value), false, &truncated); in udev_rule_apply_token_to_event()
2348 … (void) udev_event_apply_format(event, token->data, buf, sizeof(buf), false, &truncated); in udev_rule_apply_token_to_event()
2355 … (void) udev_event_apply_format(event, token->value, value, sizeof(value), false, &truncated); in udev_rule_apply_token_to_event()
2375 if (event->run_final) in udev_rule_apply_token_to_event()
2378 event->run_final = true; in udev_rule_apply_token_to_event()
2381 ordered_hashmap_clear_free_key(event->run_list); in udev_rule_apply_token_to_event()
2383 … (void) udev_event_apply_format(event, token->value, buf, sizeof(buf), false, &truncated); in udev_rule_apply_token_to_event()
2394 r = ordered_hashmap_ensure_put(&event->run_list, NULL, cmd, token->data); in udev_rule_apply_token_to_event()
2421 UdevEvent *event, in udev_rule_apply_parent_token_to_event() argument
2430 assert(event); in udev_rule_apply_parent_token_to_event()
2434 event->dev_parent = ASSERT_PTR(event->dev); in udev_rule_apply_parent_token_to_event()
2442 … r = udev_rule_apply_token_to_event(rules, event->dev_parent, event, 0, timeout_signal, NULL); in udev_rule_apply_parent_token_to_event()
2452 if (sd_device_get_parent(event->dev_parent, &event->dev_parent) < 0) { in udev_rule_apply_parent_token_to_event()
2453 event->dev_parent = NULL; in udev_rule_apply_parent_token_to_event()
2461 UdevEvent *event, in udev_rule_apply_line_to_event() argument
2473 r = sd_device_get_action(event->dev, &action); in udev_rule_apply_line_to_event()
2478 if (sd_device_get_devnum(event->dev, NULL) >= 0) in udev_rule_apply_line_to_event()
2481 if (sd_device_get_ifindex(event->dev, NULL) >= 0) in udev_rule_apply_line_to_event()
2488 event->esc = ESCAPE_UNSET; in udev_rule_apply_line_to_event()
2490 … DEVICE_TRACE_POINT(rules_apply_line, event->dev, line->rule_file->filename, line->line_number); in udev_rule_apply_line_to_event()
2499 r = udev_rule_apply_parent_token_to_event(rules, event, timeout_signal); in udev_rule_apply_line_to_event()
2507 …r = udev_rule_apply_token_to_event(rules, event->dev, event, timeout_usec, timeout_signal, propert… in udev_rule_apply_line_to_event()
2520 UdevEvent *event, in udev_rules_apply_to_event() argument
2528 assert(event); in udev_rules_apply_to_event()
2534 …r = udev_rule_apply_line_to_event(rules, event, timeout_usec, timeout_signal, properties_list, &ne… in udev_rules_apply_to_event()