<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">--- XASetOperation.c	2005-04-13 07:12:23.000000000 +0200
+++ XASetOperation.c.new	2006-04-19 17:35:55.000000000 +0200
@@ -12,13 +12,13 @@
 #include &lt;XAOperationInternal.h&gt;
 #include &lt;unistd.h&gt;
 #include &lt;stdio.h&gt;
+#include &lt;errno.h&gt;
 #include &lt;fcntl.h&gt;
 #include &lt;string.h&gt;
 #include &lt;mach/mach.h&gt;
 #include &lt;sys/types.h&gt;
 #include &lt;sys/stat.h&gt;
-
-#include "xattr.h"
+#include &lt;sys/xattr.h&gt;
 
 typedef struct __XASetOperation
 {
@@ -225,7 +225,7 @@
 
 Boolean XASetOperationPerform(XAOperationRef opaqueRef, int fd, CFStringRef path)
 {
-	Boolean bRet = 0x00;
+	Boolean bRet = 0x01;
 	
 	XASetOperationRef operationRef = (XASetOperationRef)opaqueRef;
 	
@@ -241,7 +241,21 @@
 	
 	if(CFStringGetCString(operationRef-&gt;key, key, bSize, kCFStringEncodingUTF8))
 	{
-		size = fsetxattr(fd, key, (void *)bytes, size, position, options);
+
+		int fRet = fcntl(fd, F_NOCACHE, 0x01);
+
+		if(fRet &lt; 0x00)
+			fprintf(stderr, "WARN: fcntl for key \"%s\" failed\n", key);
+		
+		int iRet = fsetxattr(fd, key, (void *)bytes, size, position, options);
+		
+		if(iRet &lt; 0x00)
+		{
+			if(errno != EEXIST || errno != ENOATTR)
+				fprintf(stderr, "ERROR: fsetxattr failed: %s\n", strerror(errno));
+
+			bRet = 0x00;
+		}
 	}
 	
 	free(key);	
</pre></body></html>