projects
/
platform
/
core
/
security
/
klay.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4180d73
)
Fix a bug that getProcessList returns garbage when cgroup is empty
author
Sungbae Yoo
<sungbae.yoo@samsung.com>
Tue, 27 Feb 2018 04:49:11 +0000
(13:49 +0900)
committer
Jaemin Ryu
<jm77.ryu@samsung.com>
Mon, 11 Feb 2019 04:22:16 +0000
(13:22 +0900)
Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
Change-Id: Ia4830daaa55cbc6b2da38673c8abdb309bb4cebf
src/cgroup.cpp
patch
|
blob
|
history
diff --git
a/src/cgroup.cpp
b/src/cgroup.cpp
index a4b6acabb20077a6b81666f47face3ca948d4acd..d136e7deb3d9397a3a5086a4fa689e24d1cfb55b 100644
(file)
--- a/
src/cgroup.cpp
+++ b/
src/cgroup.cpp
@@
-183,10
+183,13
@@
std::vector<pid_t> Cgroup::getProcessList(const std::string& subsystem, const st
std::ifstream ifs("/sys/fs/cgroup/" + subsystem + "/" + path +
"/tasks");
+ pid_t pid;
+
+ ifs >> pid;
+
while (ifs.good()) {
- pid_t pid;
- ifs >> pid;
ret.push_back(pid);
+ ifs >> pid;
}
return ret;