Lines Matching refs:path
63 const char *path; member
90 char *path; member
174 static bool perm_path_matches(const char *path, struct perms_ *dp) in perm_path_matches() argument
177 if (strncmp(path, dp->name, strlen(dp->name)) == 0) in perm_path_matches()
180 if (fnmatch(dp->name, path, FNM_PATHNAME) == 0) in perm_path_matches()
183 if (strcmp(path, dp->name) == 0) in perm_path_matches()
190 static mode_t get_device_perm(const char *path, const char **links, in get_device_perm() argument
206 if (perm_path_matches(path, dp)) { in get_device_perm()
232 static void make_device(const char *path, in make_device() argument
243 mode = get_device_perm(path, links, &uid, &gid) | (block ? S_IFBLK : S_IFCHR); in make_device()
245 if (selabel_lookup_best_match(sehandle, &secontext, path, links, mode)) { in make_device()
247 path, strerror(errno)); in make_device()
261 if (mknod(path, mode, dev) && (errno == EEXIST)) { in make_device()
262 if (lsetfilecon(path, secontext)) { in make_device()
264 secontext, path, strerror(errno)); in make_device()
267 chown(path, uid, -1); in make_device()
274 static void add_platform_device(const char *path) in add_platform_device() argument
276 int path_len = strlen(path); in add_platform_device()
278 const char *name = path; in add_platform_device()
280 if (!strncmp(path, "/devices/", 9)) { in add_platform_device()
286 INFO("adding platform device %s (%s)\n", name, path); in add_platform_device()
289 bus->path = strdup(path); in add_platform_device()
291 bus->name = bus->path + (name - path); in add_platform_device()
300 static struct platform_node *find_platform_device(const char *path) in find_platform_device() argument
302 int path_len = strlen(path); in find_platform_device()
309 (path[bus->path_len] == '/') && in find_platform_device()
310 !strncmp(path, bus->path, bus->path_len)) in find_platform_device()
317 static void remove_platform_device(const char *path) in remove_platform_device() argument
324 if (!strcmp(path, bus->path)) { in remove_platform_device()
326 free(bus->path); in remove_platform_device()
337 static int find_pci_device_prefix(const char *path, char *buf, ssize_t buf_sz) in find_pci_device_prefix() argument
341 if (strncmp(path, "/devices/pci", 12)) in find_pci_device_prefix()
345 start = path + 9; in find_pci_device_prefix()
368 uevent->path = ""; in parse_event()
384 uevent->path = msg; in parse_event()
415 uevent->action, uevent->path, uevent->subsystem, in parse_event()
429 pdev = find_platform_device(uevent->path); in get_character_device_symlinks()
439 parent = strchr(uevent->path + pdev->path_len, '/'); in get_character_device_symlinks()
484 pdev = find_platform_device(uevent->path); in get_block_device_symlinks()
488 } else if (!find_pci_device_prefix(uevent->path, buf, sizeof(buf))) { in get_block_device_symlinks()
523 slash = strrchr(uevent->path, '/'); in get_block_device_symlinks()
533 const char *path, int block, int major, int minor, char **links) in handle_device() argument
538 make_device(devpath, path, block, major, minor, (const char **)links); in handle_device()
562 const char *path = uevent->path; in handle_platform_device_event() local
565 add_platform_device(path); in handle_platform_device_event()
567 remove_platform_device(path); in handle_platform_device_event()
579 name = strrchr(uevent->path, '/'); in parse_device_name()
608 if (!strncmp(uevent->path, "/devices/", 9)) in handle_block_device_event()
611 handle_device(uevent->action, devpath, uevent->path, 1, in handle_block_device_event()
741 handle_device(uevent->action, devpath, uevent->path, 0, in handle_generic_device_event()
748 fixup_sys_perms(uevent->path); in handle_device_event()
810 uevent->firmware, uevent->path); in process_firmware_event()
812 l = asprintf(&root, SYSFS_PREFIX"%s/", uevent->path); in process_firmware_event()
967 static void coldboot(const char *path) in coldboot() argument
969 DIR *d = opendir(path); in coldboot()