- util_remove_trailing_chars(path, '/');
-
- /* possibly resolve to real devpath */
- if (util_resolve_sys_link(udev, path, sizeof(path)) != 0) {
- char temp[UTIL_PATH_SIZE];
- char *pos;
-
- /* also check if the parent is a link */
- util_strlcpy(temp, path, sizeof(temp));
- pos = strrchr(temp, '/');
- if (pos != 0) {
- char tail[UTIL_PATH_SIZE];
-
- util_strlcpy(tail, pos, sizeof(tail));
- pos[0] = '\0';
- if (util_resolve_sys_link(udev, temp, sizeof(temp)) == 0) {
- util_strlcpy(path, temp, sizeof(path));
- util_strlcat(path, tail, sizeof(path));
- }
- }