Lines Matching defs:slink
101 static int node_symlink(const char *node, const char *slink)
112 while (node[i] && (node[i] == slink[i])) {
117 while (slink[i] != '\0') {
118 if (slink[i] == '/')
125 if (lstat(slink, &stats) == 0) {
129 info("found existing node instead of symlink '%s'", slink);
133 info("replace device node '%s' with symlink to our node '%s'", slink, node);
135 err("device node '%s' already exists, link '%s' will not overwrite it", node, slink);
142 info("found existing symlink '%s'", slink);
143 len = readlink(slink, buf, sizeof(buf));
147 info("preserve already existing symlink '%s' to '%s'", slink, target);
148 selinux_setfilecon(slink, NULL, S_IFLNK);
154 info("creating symlink '%s' to '%s'", slink, target);
155 selinux_setfscreatecon(slink, NULL, S_IFLNK);
156 retval = symlink(target, slink);
162 info("atomically replace '%s'", slink);
163 strlcpy(slink_tmp, slink, sizeof(slink_tmp));
172 retval = rename(slink_tmp, slink);
174 err("rename(%s, %s) failed: %s", slink_tmp, slink, strerror(errno));
185 char slink[PATH_SIZE];
194 strlcpy(slink, udev_root, sizeof(slink));
195 strlcat(slink, "/", sizeof(slink));
196 strlcat(slink, name, sizeof(slink));
205 unlink(slink);
206 delete_path(slink);
254 create_path(slink);
255 node_symlink(node, slink);