--- XARemoveOperation.c 2005-02-11 21:08:05.000000000 +0100
+++ XARemoveOperation.c.new 2006-04-19 17:35:08.000000000 +0200
@@ -9,7 +9,9 @@
#include "XARemoveOperation.h"
#include <XAOperationInternal.h>
-#include "xattr.h"
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/xattr.h>
typedef struct __XARemoveOperation
{
@@ -121,7 +123,7 @@
Boolean XARemoveOperationPerform(XAOperationRef opaqueRef, int fd, CFStringRef path)
{
- Boolean bRet = 0x00;
+ Boolean bRet = 0x01;
XARemoveOperationRef operationRef = (XARemoveOperationRef)opaqueRef;
@@ -129,14 +131,22 @@
char *key = calloc(bSize, sizeof(*key));
- int options = XATTR_CREATE | XATTR_REPLACE;
+ int options = 0x00;
if(CFStringGetCString(operationRef->key, key, bSize, kCFStringEncodingUTF8))
{
+ int fRet = fcntl(fd, F_NOCACHE, 0x01);
+
+ if(fRet < 0x00)
+ fprintf(stderr, "WARN: fcntl for key \"%s\" failed\n", key);
+
int iRet = fremovexattr(fd, key, options);
if(iRet < 0x00)
{
+ if(errno != ENOATTR)
+ fprintf(stderr, "ERROR: fremovexattr failed: %s\n", strerror(errno));
+
bRet = 0x00;
}
}