Skip to content

Commit cd9ca29

Browse files
authored
Update linux_parser.cpp
1 parent 3ca43c3 commit cd9ca29

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/linux_parser.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ string LinuxParser::OperatingSystem() {
3535

3636
// DONE: An example of how to read data from the filesystem
3737
string LinuxParser::Kernel() {
38-
string os, kernel;
38+
string os, kernel, version;
3939
string line;
4040
std::ifstream stream(kProcDirectory + kVersionFilename);
4141
if (stream.is_open()) {
4242
std::getline(stream, line);
4343
std::istringstream linestream(line);
44-
linestream >> os >> kernel;
44+
linestream >> os >> version >> kernel;
4545
}
4646
return kernel;
4747
}
@@ -112,4 +112,4 @@ string LinuxParser::User(int pid[[maybe_unused]]) { return string(); }
112112

113113
// TODO: Read and return the uptime of a process
114114
// REMOVE: [[maybe_unused]] once you define the function
115-
long LinuxParser::UpTime(int pid[[maybe_unused]]) { return 0; }
115+
long LinuxParser::UpTime(int pid[[maybe_unused]]) { return 0; }

0 commit comments

Comments
 (0)