OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromecast/crash/linux/synchronized_minidump_manager.h" | 5 #include "chromecast/crash/linux/synchronized_minidump_manager.h" |
6 | 6 |
7 #include <dirent.h> | 7 #include <dirent.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <grp.h> | 10 #include <grp.h> |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 LOG(ERROR) << lockfile_path_ << " could not be opened."; | 149 LOG(ERROR) << lockfile_path_ << " could not be opened."; |
150 return -1; | 150 return -1; |
151 } | 151 } |
152 | 152 |
153 // Grab each entry. | 153 // Grab each entry. |
154 while (std::getline(in, entry)) { | 154 while (std::getline(in, entry)) { |
155 scoped_ptr<DumpInfo> info(new DumpInfo(entry)); | 155 scoped_ptr<DumpInfo> info(new DumpInfo(entry)); |
156 if (info->valid() && info->crashed_process_dump().size() > 0) { | 156 if (info->valid() && info->crashed_process_dump().size() > 0) { |
157 dumps->push_back(info.Pass()); | 157 dumps->push_back(info.Pass()); |
158 } else { | 158 } else { |
159 LOG(WARNING) << "Entry is not valid: " << entry; | 159 LOG(WARNING) << "Ignoring invalid entry: " << entry; |
wzhong
2015/07/16 22:46:44
Remove {} for simple if else statement.
slan
2015/07/16 22:57:31
Done.
| |
160 return -1; | |
161 } | 160 } |
162 } | 161 } |
163 | 162 |
164 dump_metadata_ = dumps.Pass(); | 163 dump_metadata_ = dumps.Pass(); |
165 return 0; | 164 return 0; |
166 } | 165 } |
167 | 166 |
168 int SynchronizedMinidumpManager::AddEntryToLockFile(const DumpInfo& dump_info) { | 167 int SynchronizedMinidumpManager::AddEntryToLockFile(const DumpInfo& dump_info) { |
169 DCHECK_LE(0, lockfile_fd_); | 168 DCHECK_LE(0, lockfile_fd_); |
170 | 169 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
210 close(lockfile_fd_); | 209 close(lockfile_fd_); |
211 | 210 |
212 // We may use this object again, so we should reset this. | 211 // We may use this object again, so we should reset this. |
213 lockfile_fd_ = -1; | 212 lockfile_fd_ = -1; |
214 } | 213 } |
215 | 214 |
216 dump_metadata_.reset(); | 215 dump_metadata_.reset(); |
217 } | 216 } |
218 | 217 |
219 } // namespace chromecast | 218 } // namespace chromecast |
OLD | NEW |