luci-app-diskman: sync with upstream source

This commit is contained in:
CN_SZTL 2020-11-21 18:30:32 +08:00
parent 48fe3ccd2e
commit 06a6e47d95
No known key found for this signature in database
GPG Key ID: 6850B6345C862176

View File

@ -412,8 +412,8 @@ d.list_devices = function()
for i, bname in pairs(target_devnames) do
local device_info = {}
local device = "/dev/" .. bname
local size = tonumber(fs.readfile(string.format("/sys/class/block/%s/size", bname)))
local ss = tonumber(fs.readfile(string.format("/sys/class/block/%s/queue/logical_block_size", bname)))
local size = tonumber(fs.readfile(string.format("/sys/class/block/%s/size", bname)) or "0")
local ss = tonumber(fs.readfile(string.format("/sys/class/block/%s/queue/logical_block_size", bname)) or "0")
local model = fs.readfile(string.format("/sys/class/block/%s/device/model", bname))
local partitions = {}
for part in nixio.fs.glob("/sys/block/" .. bname .."/" .. bname .. "*") do