mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
DiskIO (Linux): detect device serial number
This commit is contained in:
@@ -13,6 +13,7 @@ typedef struct FFDiskIOResult
|
||||
{
|
||||
FFstrbuf name;
|
||||
FFstrbuf interconnect;
|
||||
FFstrbuf serial;
|
||||
FFDiskIOPhysicalType type;
|
||||
uint64_t size;
|
||||
FFstrbuf devPath;
|
||||
|
||||
@@ -110,6 +110,12 @@ const char* ffDiskIOGetIoCounters(FFlist* result, FFDiskIOOptions* options)
|
||||
else
|
||||
device->size = 0;
|
||||
}
|
||||
|
||||
{
|
||||
ffStrbufInit(&device->serial);
|
||||
snprintf(pathSysBlock, PATH_MAX, "/sys/block/%s/serial", devName);
|
||||
ffReadFileBuffer(pathSysBlock, &device->serial);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user