Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1326)

Unified Diff: base/safe_strerror_posix.h

Issue 1160373004: Move safe_strerror to posix directory and the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/posix/safe_strerror.cc ('k') | base/safe_strerror_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/safe_strerror_posix.h
diff --git a/base/safe_strerror_posix.h b/base/safe_strerror_posix.h
deleted file mode 100644
index 2f77d84a1b96df127c867ff7bcd3d31bcdc0081a..0000000000000000000000000000000000000000
--- a/base/safe_strerror_posix.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef BASE_SAFE_STRERROR_POSIX_H_
-#define BASE_SAFE_STRERROR_POSIX_H_
-
-#include <string>
-
-#include "base/base_export.h"
-
-// BEFORE using anything from this file, first look at PLOG and friends in
-// logging.h and use them instead if applicable.
-//
-// This file declares safe, portable alternatives to the POSIX strerror()
-// function. strerror() is inherently unsafe in multi-threaded apps and should
-// never be used. Doing so can cause crashes. Additionally, the thread-safe
-// alternative strerror_r varies in semantics across platforms. Use these
-// functions instead.
-
-// Thread-safe strerror function with dependable semantics that never fails.
-// It will write the string form of error "err" to buffer buf of length len.
-// If there is an error calling the OS's strerror_r() function then a message to
-// that effect will be printed into buf, truncating if necessary. The final
-// result is always null-terminated. The value of errno is never changed.
-//
-// Use this instead of strerror_r().
-BASE_EXPORT void safe_strerror_r(int err, char *buf, size_t len);
-
-// Calls safe_strerror_r with a buffer of suitable size and returns the result
-// in a C++ string.
-//
-// Use this instead of strerror(). Note though that safe_strerror_r will be
-// more robust in the case of heap corruption errors, since it doesn't need to
-// allocate a string.
-BASE_EXPORT std::string safe_strerror(int err);
-
-#endif // BASE_SAFE_STRERROR_POSIX_H_
« no previous file with comments | « base/posix/safe_strerror.cc ('k') | base/safe_strerror_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698