Chromium Code Reviews| Index: base/linux_util.cc |
| =================================================================== |
| --- base/linux_util.cc (revision 88621) |
| +++ base/linux_util.cc (working copy) |
| @@ -252,7 +252,8 @@ |
| return already_found; |
| } |
| -pid_t FindThreadIDWithSyscall(pid_t pid, const std::string& expected_data) { |
| +pid_t FindThreadIDWithSyscall(pid_t pid, const std::string& expected_data, |
| + bool* syscall_supported) { |
| char buf[256]; |
| snprintf(buf, sizeof(buf), "/proc/%d/task", pid); |
| DIR* task = opendir(buf); |
| @@ -273,6 +274,7 @@ |
| closedir(task); |
| scoped_array<char> syscall_data(new char[expected_data.length()]); |
| + *syscall_supported = false; |
|
Mark Mentovai
2011/06/21 00:11:24
Can you do this at the very beginning of the funct
kmixter1
2011/06/21 00:55:33
Good catch. Moved it up so that it's always set t
|
| for (std::vector<pid_t>::const_iterator |
| i = tids.begin(); i != tids.end(); ++i) { |
| const pid_t current_tid = *i; |
| @@ -280,6 +282,7 @@ |
| int fd = open(buf, O_RDONLY); |
| if (fd < 0) |
| continue; |
| + *syscall_supported = true; |
| bool read_ret = |
| file_util::ReadFromFD(fd, syscall_data.get(), expected_data.length()); |
| close(fd); |