aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/native
diff options
context:
space:
mode:
authorGravatar John Cater <jcater@google.com>2018-02-22 11:56:42 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-02-22 11:58:20 -0800
commitb3729d8570c6a0c2a8d14dfa393b81862d039a5d (patch)
tree1b8c48bf1572473e79036d055b29c80a6ca5e4a8 /src/main/native
parentec0855331c8f81b8eff738669d800b6d7f34271d (diff)
Update FreeBSD JNI to support new attr_not_found parameter.
Fixes #4674. Tested: https://ci.bazel.build/blue/organizations/jenkins/CR%2Fbazel-tests/detail/bazel-tests/903/pipeline/ (FreeBSD tests pass, failures are unrelated) Change-Id: Ifc9c5be0cb4d7c877c64fc21632ae8a8c9582d33 PiperOrigin-RevId: 186651937
Diffstat (limited to 'src/main/native')
-rw-r--r--src/main/native/unix_jni_freebsd.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/native/unix_jni_freebsd.cc b/src/main/native/unix_jni_freebsd.cc
index 5be1d4d645..3b60e297bf 100644
--- a/src/main/native/unix_jni_freebsd.cc
+++ b/src/main/native/unix_jni_freebsd.cc
@@ -71,13 +71,19 @@ int StatNanoSeconds(const portable_stat_struct &statbuf, StatTimes t) {
}
ssize_t portable_getxattr(const char *path, const char *name, void *value,
- size_t size) {
- return extattr_get_file(path, EXTATTR_NAMESPACE_SYSTEM, name, value, size);
+ size_t size, bool *attr_not_found) {
+ ssize_t result =
+ extattr_get_file(path, EXTATTR_NAMESPACE_SYSTEM, name, value, size);
+ *attr_not_found = (errno == ENOATTR);
+ return result;
}
ssize_t portable_lgetxattr(const char *path, const char *name, void *value,
- size_t size) {
- return extattr_get_link(path, EXTATTR_NAMESPACE_SYSTEM, name, value, size);
+ size_t size, bool *attr_not_found) {
+ ssize_t result =
+ extattr_get_link(path, EXTATTR_NAMESPACE_SYSTEM, name, value, size);
+ *attr_not_found = (errno == ENOATTR);
+ return result;
}
int portable_sysctlbyname(const char *name_chars, long *mibp, size_t *sizep) {