Skip to content

Commit dfb2333

Browse files
committed
Removed mutable member from ProcInfoFetcher
1 parent 9fcde00 commit dfb2333

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

FWCore/Services/plugins/ProcInfoFetcher.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <cstring>
1818
#include <cassert>
1919
#include <iostream>
20+
#include <array>
2021
#ifdef __linux__
2122
#include <malloc.h>
2223
#endif
@@ -193,16 +194,18 @@ namespace edm {
193194

194195
lseek(fd_, 0, SEEK_SET);
195196

196-
if ((cnt = read(fd_, buf_, sizeof(buf_) - 1)) < 0) {
197+
std::array<char, 500> buf;
198+
199+
if ((cnt = read(fd_, buf.data(), buf.size() - 1)) < 0) {
197200
perror("Read of Proc file failed:");
198201
return ProcInfo();
199202
}
200203

201204
if (cnt > 0) {
202-
buf_[cnt] = '\0';
205+
buf[cnt] = '\0';
203206

204207
try {
205-
Fetcher fetcher(buf_);
208+
Fetcher fetcher(buf.data());
206209
fetcher >> pinfo.pid >> pinfo.comm >> pinfo.state >> pinfo.ppid >> pinfo.pgrp >> pinfo.session >> pinfo.tty >>
207210
pinfo.tpgid >> pinfo.flags >> pinfo.minflt >> pinfo.cminflt >> pinfo.majflt >> pinfo.cmajflt >>
208211
pinfo.utime >> pinfo.stime >> pinfo.cutime >> pinfo.cstime >> pinfo.priority >> pinfo.nice >>

FWCore/Services/plugins/ProcInfoFetcher.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ namespace edm {
5050
private:
5151
double pg_size_;
5252
int fd_;
53-
mutable char buf_[500];
5453
};
5554
} // namespace service
5655
} // namespace edm

0 commit comments

Comments
 (0)