| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 #include "base/safe_strerror_posix.h" | 6 #include "base/safe_strerror_posix.h" |
| 7 | 7 |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <stdio.h> | 9 #include <stdio.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| 11 | 11 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // static. | 102 // static. |
| 103 wrap_posix_strerror_r(&strerror_r, err, buf, len); | 103 wrap_posix_strerror_r(&strerror_r, err, buf, len); |
| 104 } | 104 } |
| 105 | 105 |
| 106 std::string safe_strerror(int err) { | 106 std::string safe_strerror(int err) { |
| 107 const int buffer_size = 256; | 107 const int buffer_size = 256; |
| 108 char buf[buffer_size]; | 108 char buf[buffer_size]; |
| 109 safe_strerror_r(err, buf, sizeof(buf)); | 109 safe_strerror_r(err, buf, sizeof(buf)); |
| 110 return std::string(buf); | 110 return std::string(buf); |
| 111 } | 111 } |
| OLD | NEW |