Lines Matching refs:slink
44 static int create_symlink(const char *target, const char *slink) { in create_symlink() argument
48 assert(slink); in create_symlink()
51 r = mkdir_parents_label(slink, 0755); in create_symlink()
57 mac_selinux_create_file_prepare(slink, S_IFLNK); in create_symlink()
58 r = RET_NERRNO(symlink(target, slink)); in create_symlink()
67 static int node_symlink(sd_device *dev, const char *node, const char *slink) { in node_symlink() argument
75 assert(slink); in node_symlink()
77 if (lstat(slink, &stats) >= 0) { in node_symlink()
80 … "Conflicting inode '%s' found, link to '%s' will not be created.", slink, node); in node_symlink()
82 return log_device_debug_errno(dev, errno, "Failed to lstat() '%s': %m", slink); in node_symlink()
84 r = path_extract_directory(slink, &slink_dirname); in node_symlink()
86 … return log_device_debug_errno(dev, r, "Failed to get parent directory of '%s': %m", slink); in node_symlink()
91 …n log_device_debug_errno(dev, r, "Failed to get relative path from '%s' to '%s': %m", slink, node); in node_symlink()
97 slink_tmp = strjoina(slink, ".tmp-", id); in node_symlink()
104 if (rename(slink_tmp, slink) < 0) { in node_symlink()
105 … r = log_device_debug_errno(dev, errno, "Failed to rename '%s' to '%s': %m", slink_tmp, slink); in node_symlink()
419 _cleanup_free_ char *slink = NULL, *dirname = NULL; in link_update() local
427 slink = strdup(slink_in); in link_update()
428 if (!slink) in link_update()
431 path_simplify(slink); in link_update()
433 slink_name = path_startswith(slink, "/dev"); in link_update()
438 "Invalid symbolic link of device node: %s", slink); in link_update()
457 dirname, slink, FORMAT_TIMESPAN(delay, USEC_PER_MSEC)); in link_update()
466 …bug_errno(dev, r, "Failed to determine device node with the highest priority for '%s': %m", slink); in link_update()
468 log_device_debug(dev, "No reference left for '%s', removing", slink); in link_update()
470 if (unlink(slink) < 0 && errno != ENOENT) in link_update()
471 … log_device_debug_errno(dev, errno, "Failed to remove '%s', ignoring: %m", slink); in link_update()
473 (void) rmdir_parents(slink, "/dev"); in link_update()
477 r = node_symlink(dev, target, slink); in link_update()