File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 4
4
#include < filesystem>
5
5
#include < folly/logging/xlog.h>
6
6
#include < fstream>
7
+ #include < sys/sysmacros.h>
7
8
#include < unistd.h>
8
9
9
10
#include " common/serde/Serde.h"
@@ -129,7 +130,10 @@ Result<std::vector<SysResource::DiskInfo>> SysResource::scanDiskInfo() {
129
130
std::string deviceIdStr;
130
131
std::string mountPath;
131
132
std::string devicePath;
132
- if (is >> dummy >> dummy >> deviceIdStr >> dummy >> mountPath >> dummy >> dummy >> dummy >> dummy >> devicePath) {
133
+ is >> dummy >> dummy >> deviceIdStr >> dummy >> mountPath;
134
+ while ((is >> dummy) && dummy != " -" )
135
+ ;
136
+ if (is >> dummy >> devicePath) {
133
137
unsigned long maj, min;
134
138
auto parseResult = scn::scan (deviceIdStr, " {}:{}" , maj, min);
135
139
if (!parseResult) {
@@ -139,7 +143,7 @@ Result<std::vector<SysResource::DiskInfo>> SysResource::scanDiskInfo() {
139
143
140
144
if (deviceToUUID.count (devicePath)) {
141
145
infos.emplace_back ();
142
- infos.back ().deviceId = maj * 256 + min;
146
+ infos.back ().deviceId = makedev ( maj, min) ;
143
147
infos.back ().uuid = deviceToUUID[devicePath];
144
148
infos.back ().devicePath = devicePath;
145
149
infos.back ().mountPath = mountPath;
You can’t perform that action at this time.
0 commit comments