Lines Matching defs:slink
36 static int node_symlink(struct udev_device *dev, const char *node, const char *slink) {
48 while (node[i] && (node[i] == slink[i])) {
55 while (slink[i] != '\0') {
56 if (slink[i] == '/')
67 if (lstat(slink, &stats) == 0) {
69 log_error("conflicting device node '%s' found, link to '%s' will not be created", slink, node);
75 len = readlink(slink, buf, sizeof(buf));
79 log_debug("preserve already existing symlink '%s' to '%s'", slink, target);
80 label_fix(slink, true, false);
81 utimensat(AT_FDCWD, slink, NULL, AT_SYMLINK_NOFOLLOW);
87 log_debug("creating symlink '%s' to '%s'", slink, target);
89 err = mkdir_parents_label(slink, 0755);
92 mac_selinux_create_file_prepare(slink, S_IFLNK);
93 err = symlink(target, slink);
102 log_debug("atomically replace '%s'", slink);
103 strscpyl(slink_tmp, sizeof(slink_tmp), slink, ".tmp-", udev_device_get_id_filename(dev), NULL);
119 err = rename(slink_tmp, slink);
121 log_error_errno(errno, "rename '%s' '%s' failed: %m", slink_tmp, slink);
182 static void link_update(struct udev_device *dev, const char *slink, bool add) {
189 util_path_encode(slink + strlen("/dev"), name_enc, sizeof(name_enc));
198 log_debug("no reference left, remove '%s'", slink);
199 if (unlink(slink) == 0)
200 rmdir_parents(slink, "/");
202 log_debug("creating link '%s' to '%s'", slink, target);
203 node_symlink(dev, target, slink);