Skip to content

Commit 87bd195

Browse files
committed
POSIX error ENODATA has been deprecated.
Chromium (libc++) change: llvm/llvm-project#80542 commit e3fe3e833ae34840f04f0999fa3538c554010e9b Author: Mark de Wever <[email protected]> Date: Thu Mar 21 12:14:24 2024 +0100 [libc++] Deprecates std::errc constants. (#80542) Implements: - LWG3869 Deprecate std::errc constants related to UNIX STREAMS
1 parent 3fcdead commit 87bd195

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

components/brave_referrals/browser/file_extended_attribute.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ int GetFileExtendedAttribute(const base::FilePath& path,
2626
ssize_t length = getxattr(path.value().c_str(), name, value->data(),
2727
expected_length, /*position=*/0,
2828
/*options=*/0);
29-
if (length != expected_length) {
29+
if (length < 0) {
30+
return errno;
31+
} else if (length != expected_length) {
3032
VLOG(0) << "Failed to retrieve extended attribute " << name << " from file "
3133
<< path << ". The expected data length (" << expected_length
3234
<< ") and actual data length (" << length << ") do not match.";
33-
return ENODATA;
35+
return ENOTRECOVERABLE;
3436
}
3537

3638
return 0;

components/brave_referrals/browser/file_extended_attribute.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace brave {
1818
// interest:
1919
// ENOATTR - the attribute with the given |name| was not found.
2020
// ENOTSUP - the file system doesn't support (or disabled) extended attributes.
21-
// ENODATA - the value could not be retrieved.
21+
// ENOTRECOVERABLE - the value could not be retrieved.
2222
int GetFileExtendedAttribute(const base::FilePath& path,
2323
const char* name,
2424
std::vector<char>* value);

0 commit comments

Comments
 (0)