Rebase against e909986e6ea5ecd49b2b847f321ad89b2ae4f6f1.

This commit is contained in:
Alistair Leslie-Hughes
2020-10-15 08:48:35 +11:00
parent 6a87f0a479
commit 6d726da3ba
5 changed files with 45 additions and 50 deletions

View File

@@ -1,18 +1,18 @@
From f4caa19ffcac13201c0c9bd45d3d93d44cb24980 Mon Sep 17 00:00:00 2001
From 2b9b382e84ae850599bac82910efa0811b085e58 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Mon, 6 Oct 2014 14:26:24 -0600
Subject: [PATCH] libport: Add support for FreeBSD style extended attributes.
---
configure.ac | 2 +-
dlls/ntdll/unix/file.c | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
dlls/ntdll/unix/file.c | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 5e33bfacf91..aef00416461 100644
index e17d0498a58..1411f1b88f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -701,7 +701,7 @@ AC_CHECK_HEADERS([libprocstat.h],,,
@@ -695,7 +695,7 @@ AC_CHECK_HEADERS([libprocstat.h],,,
if test "x$with_xattr" != "xno"
then
@@ -22,10 +22,20 @@ index 5e33bfacf91..aef00416461 100644
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/xattr.h>]], [[getxattr("", "", "", 0, 0, 0);]])],
[AC_DEFINE(XATTR_ADDITIONAL_OPTIONS, 1, [Define if xattr functions take additional arguments (Mac OS X)])])])
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 5e0ac914e1c..c4d5f9c9028 100644
index 388ef0671fc..cbd8c7ea3db 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -385,6 +385,9 @@ static int xattr_fremove( int filedes, const char *name )
@@ -111,6 +111,9 @@
#elif defined(HAVE_SYS_XATTR_H)
#include <sys/xattr.h>
#endif
+#ifdef HAVE_SYS_EXTATTR_H
+#include <sys/extattr.h>
+#endif
#include <time.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
@@ -385,6 +388,9 @@ static int xattr_fremove( int filedes, const char *name )
return fremovexattr( filedes, name, 0 );
#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H)
return fremovexattr( filedes, name );
@@ -35,7 +45,7 @@ index 5e0ac914e1c..c4d5f9c9028 100644
#else
errno = ENOSYS;
return -1;
@@ -397,6 +400,10 @@ static int xattr_fset( int filedes, const char *name, void *value, size_t size )
@@ -397,6 +403,10 @@ static int xattr_fset( int filedes, const char *name, void *value, size_t size )
return fsetxattr( filedes, name, value, size, 0, 0 );
#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H)
return fsetxattr( filedes, name, value, size, 0 );
@@ -46,7 +56,7 @@ index 5e0ac914e1c..c4d5f9c9028 100644
#else
errno = ENOSYS;
return -1;
@@ -409,6 +416,10 @@ static int xattr_get( const char *path, const char *name, void *value, size_t si
@@ -409,6 +419,10 @@ static int xattr_get( const char *path, const char *name, void *value, size_t si
return getxattr( path, name, value, size, 0, 0 );
#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H)
return getxattr( path, name, value, size );
@@ -57,7 +67,7 @@ index 5e0ac914e1c..c4d5f9c9028 100644
#else
errno = ENOSYS;
return -1;
@@ -421,6 +432,9 @@ static int xattr_remove( const char *path, const char *name )
@@ -421,6 +435,9 @@ static int xattr_remove( const char *path, const char *name )
return removexattr( path, name, 0 );
#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H)
return removexattr( path, name );
@@ -67,7 +77,7 @@ index 5e0ac914e1c..c4d5f9c9028 100644
#else
errno = ENOSYS;
return -1;
@@ -433,6 +447,10 @@ static int xattr_set( const char *path, const char *name, void *value, size_t si
@@ -433,6 +450,10 @@ static int xattr_set( const char *path, const char *name, void *value, size_t si
return setxattr( path, name, value, size, 0, 0 );
#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H)
return setxattr( path, name, value, size, 0 );