summaryrefslogtreecommitdiff
path: root/extras/multipath/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'extras/multipath/main.c')
-rw-r--r--extras/multipath/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/extras/multipath/main.c b/extras/multipath/main.c
index f62e0f9954..a8e29e8ba6 100644
--- a/extras/multipath/main.c
+++ b/extras/multipath/main.c
@@ -261,7 +261,11 @@ get_all_paths_sysfs(struct env * conf, struct path * all_paths)
sprintf(buff, "%s%s/block",
conf->sysfs_path, conf->hotplugdev);
memset(conf->hotplugdev, 0, FILE_NAME_SIZE);
- readlink(buff, conf->hotplugdev, FILE_NAME_SIZE);
+
+ /* if called from hotplug but with no block, leave */
+ if (0 > readlink(buff, conf->hotplugdev, FILE_NAME_SIZE))
+ return 0;
+
basename(conf->hotplugdev, buff);
sprintf(curpath.sg_dev, "/dev/%s", buff);