use HostSys to construct device path

This commit is contained in:
Nico Vinzens 2018-10-17 14:45:40 +02:00
parent 813c630e9c
commit 23dfe98621
1 changed files with 1 additions and 2 deletions

View File

@ -272,8 +272,7 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro
// /dev/root is not the real device name // /dev/root is not the real device name
// so we get the real device name from its major/minor number // so we get the real device name from its major/minor number
if d.Device == "/dev/root" { if d.Device == "/dev/root" {
link := "/sys/dev/block/" + blockDeviceID devpath, err := os.Readlink(common.HostSys("/dev/block/" + blockDeviceID))
devpath, err := os.Readlink(link)
if err != nil { if err != nil {
return nil, err return nil, err
} }