| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
| 13 #include "base/logging.h" | |
| 14 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 15 | 14 |
| 16 namespace file_util { | 15 namespace file_util { |
| 17 | 16 |
| 18 bool GetTempDir(FilePath* path) { | 17 bool GetTempDir(FilePath* path) { |
| 19 const char* tmp = getenv("TMPDIR"); | 18 const char* tmp = getenv("TMPDIR"); |
| 20 if (tmp) | 19 if (tmp) |
| 21 *path = FilePath(tmp); | 20 *path = FilePath(tmp); |
| 22 else | 21 else |
| 23 *path = FilePath("/tmp"); | 22 *path = FilePath("/tmp"); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 68 |
| 70 if (close(infile) < 0) | 69 if (close(infile) < 0) |
| 71 result = false; | 70 result = false; |
| 72 if (close(outfile) < 0) | 71 if (close(outfile) < 0) |
| 73 result = false; | 72 result = false; |
| 74 | 73 |
| 75 return result; | 74 return result; |
| 76 } | 75 } |
| 77 | 76 |
| 78 } // namespace file_util | 77 } // namespace file_util |
| OLD | NEW |