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

Unified Diff: util/mac/xattr.cc

Issue 842513002: Create CrashReportDatabase interface, a test, and a Mac implementation. (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 11 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
Index: util/mac/xattr.cc
diff --git a/util/mac/xattr.cc b/util/mac/xattr.cc
index 750a056d4bac995d64690f8fd4fb5d962281b53c..cdd92090d46f92c764362739057d47a01e6e7d04 100644
--- a/util/mac/xattr.cc
+++ b/util/mac/xattr.cc
@@ -14,6 +14,7 @@
#include "util/mac/xattr.h"
+#include <errno.h>
#include <stdint.h>
#include <sys/xattr.h>
@@ -25,6 +26,15 @@
namespace crashpad {
+bool HasXattr(const base::FilePath& file, const base::StringPiece& name) {
+ if (getxattr(file.value().c_str(), name.data(), nullptr, 0, 0, 0) < 0) {
+ PLOG_IF(ERROR, errno != ENOATTR)
+ << "getxattr exists " << name << " on file " << file.value();
+ return false;
+ }
+ return true;
+}
+
bool ReadXattr(const base::FilePath& file,
const base::StringPiece& name,
std::string* value) {

Powered by Google App Engine
This is Rietveld 408576698