Commit 313bd99b authored by Harald Sitter's avatar Harald Sitter
Browse files

fix device type check for freebsd

on freebsd there are only character devices. This is a bit meh because
more than actual disks devices match this check but Adriaan knows no
better options either short of what smartctl needs to do anyway, so we'd
not win much by complicating matters on our end.


(cherry picked from commit 95761dde)
parent 97ec1c6e
...@@ -36,7 +36,11 @@ static QString nameToPath(const QString &name) ...@@ -36,7 +36,11 @@ static QString nameToPath(const QString &name)
return {}; return {};
} }
#ifdef Q_OS_FREEBSD // There are only character devices
if (!S_ISCHR(sb.st_mode)) {
#else // On others assume they are block devices (e.g. linux)
if (!S_ISBLK(sb.st_mode)) { if (!S_ISBLK(sb.st_mode)) {
#endif
qWarning() << "Device is not actually a block device" << name; qWarning() << "Device is not actually a block device" << name;
return {}; return {};
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment