Lines Matching refs:links
185 static mode_t get_device_perm(const char *path, const char **links, in get_device_perm() argument
204 if (links) { in get_device_perm()
206 for (i = 0; links[i]; i++) { in get_device_perm()
207 if (perm_path_matches(links[i], dp)) { in get_device_perm()
230 const char **links) in make_device() argument
238 mode = get_device_perm(path, links, &uid, &gid) | (block ? S_IFBLK : S_IFCHR); in make_device()
241 if (selabel_lookup_best_match(sehandle, &secontext, path, links, mode)) { in make_device()
480 char **links; in get_character_device_symlinks() local
489 links = (char**) malloc(sizeof(char *) * 2); in get_character_device_symlinks()
490 if (!links) in get_character_device_symlinks()
492 memset(links, 0, sizeof(char *) * 2); in get_character_device_symlinks()
513 if (asprintf(&links[link_num], "/dev/usb/%s%.*s", uevent->subsystem, width, parent) > 0) in get_character_device_symlinks()
516 links[link_num] = NULL; in get_character_device_symlinks()
523 return links; in get_character_device_symlinks()
525 free(links); in get_character_device_symlinks()
553 char **links = (char**) malloc(sizeof(char *) * 4); in get_block_device_symlinks() local
554 if (!links) in get_block_device_symlinks()
556 memset(links, 0, sizeof(char *) * 4); in get_block_device_symlinks()
568 if (asprintf(&links[link_num], "%s/by-name/%s", link_path, p) > 0) in get_block_device_symlinks()
571 links[link_num] = NULL; in get_block_device_symlinks()
576 if (asprintf(&links[link_num], "%s/by-num/p%d", link_path, uevent->partition_num) > 0) in get_block_device_symlinks()
579 links[link_num] = NULL; in get_block_device_symlinks()
583 if (asprintf(&links[link_num], "%s/%s", link_path, slash + 1) > 0) in get_block_device_symlinks()
586 links[link_num] = NULL; in get_block_device_symlinks()
588 return links; in get_block_device_symlinks()
610 const char *path, int block, int major, int minor, char **links) in handle_device() argument
613 make_device(devpath, path, block, major, minor, (const char **)links); in handle_device()
614 if (links) { in handle_device()
615 for (int i = 0; links[i]; i++) { in handle_device()
616 make_link_init(devpath, links[i]); in handle_device()
622 if (links) { in handle_device()
623 for (int i = 0; links[i]; i++) { in handle_device()
624 remove_link(devpath, links[i]); in handle_device()
630 if (links) { in handle_device()
631 for (int i = 0; links[i]; i++) { in handle_device()
632 free(links[i]); in handle_device()
634 free(links); in handle_device()
679 char **links = NULL; in handle_block_device_event() local
689 links = get_block_device_symlinks(uevent); in handle_block_device_event()
692 uevent->major, uevent->minor, links); in handle_block_device_event()
726 char **links = NULL; in handle_generic_device_event() local
811 links = get_character_device_symlinks(uevent); in handle_generic_device_event()
817 uevent->major, uevent->minor, links); in handle_generic_device_event()