Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/bvar/default_variables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static bool read_proc_status(ProcStat &stat) {
",tpgid,flags,pri,nice | tail -n1", (long)pid);
if (butil::read_command_output(oss, cmdbuf) != 0) {
LOG(ERROR) << "Fail to read stat";
return -1;
return false;
}
const std::string& result = oss.str();
if (sscanf(result.c_str(), "%d %d %d %d"
Expand Down Expand Up @@ -230,7 +230,7 @@ static bool read_proc_memory(ProcMemory &m) {
snprintf(cmdbuf, sizeof(cmdbuf), "ps -p %ld -o rss=,vsz=", (long)pid);
if (butil::read_command_output(oss, cmdbuf) != 0) {
LOG(ERROR) << "Fail to read memory state";
return -1;
return false;
}
const std::string& result = oss.str();
if (sscanf(result.c_str(), "%ld %ld", &m.resident, &m.size) != 2) {
Expand Down Expand Up @@ -292,7 +292,7 @@ static bool read_load_average(LoadAverage &m) {
std::ostringstream oss;
if (butil::read_command_output(oss, "sysctl -n vm.loadavg") != 0) {
LOG(ERROR) << "Fail to read loadavg";
return -1;
return false;
}
const std::string& result = oss.str();
if (sscanf(result.c_str(), "{ %lf %lf %lf }",
Expand Down
Loading