- list_for_each_entry(name_loop, &udev->symlink_list, node) {
- int retval;
- char linktarget[PATH_SIZE];
-
- snprintf(filename, sizeof(filename), "%s/%s", udev_root, name_loop->name);
- filename[sizeof(filename)-1] = '\0';
-
- dbg("symlink '%s' to node '%s' requested", filename, udev->name);
- if (!udev->test_run)
- if (strchr(filename, '/'))
- create_path(filename);
-
- /* optimize relative link */
- linktarget[0] = '\0';
- i = 0;
- tail = 0;
- while (udev->name[i] && (udev->name[i] == name_loop->name[i])) {
- if (udev->name[i] == '/')
- tail = i+1;
- i++;
- }
- while (name_loop->name[i] != '\0') {
- if (name_loop->name[i] == '/')
- strlcat(linktarget, "../", sizeof(linktarget));
- i++;
- }
+ if (!list_empty(&udev->symlink_list)) {
+ char symlinks[512] = "";
+
+ list_for_each_entry(name_loop, &udev->symlink_list, node) {
+ int retval;
+ char linktarget[PATH_SIZE];
+
+ snprintf(filename, sizeof(filename), "%s/%s", udev_root, name_loop->name);
+ filename[sizeof(filename)-1] = '\0';
+
+ dbg("symlink '%s' to node '%s' requested", filename, udev->name);
+ if (!udev->test_run)
+ if (strchr(filename, '/'))
+ create_path(filename);
+
+ /* optimize relative link */
+ linktarget[0] = '\0';
+ i = 0;
+ tail = 0;
+ while (udev->name[i] && (udev->name[i] == name_loop->name[i])) {
+ if (udev->name[i] == '/')
+ tail = i+1;
+ i++;
+ }
+ while (name_loop->name[i] != '\0') {
+ if (name_loop->name[i] == '/')
+ strlcat(linktarget, "../", sizeof(linktarget));
+ i++;
+ }