Ticket #8484: patch-XARemoveOperation.c.diff
File patch-XARemoveOperation.c.diff, 1.1 KB (added by ulrich.kohlhase@…, 19 years ago) |
---|
-
XARemoveOperation.c
old new 9 9 10 10 #include "XARemoveOperation.h" 11 11 #include <XAOperationInternal.h> 12 #include "xattr.h" 12 #include <errno.h> 13 #include <fcntl.h> 14 #include <sys/xattr.h> 13 15 14 16 typedef struct __XARemoveOperation 15 17 { … … 121 123 122 124 Boolean XARemoveOperationPerform(XAOperationRef opaqueRef, int fd, CFStringRef path) 123 125 { 124 Boolean bRet = 0x0 0;126 Boolean bRet = 0x01; 125 127 126 128 XARemoveOperationRef operationRef = (XARemoveOperationRef)opaqueRef; 127 129 … … 129 131 130 132 char *key = calloc(bSize, sizeof(*key)); 131 133 132 int options = XATTR_CREATE | XATTR_REPLACE;134 int options = 0x00; 133 135 134 136 if(CFStringGetCString(operationRef->key, key, bSize, kCFStringEncodingUTF8)) 135 137 { 138 int fRet = fcntl(fd, F_NOCACHE, 0x01); 139 140 if(fRet < 0x00) 141 fprintf(stderr, "WARN: fcntl for key \"%s\" failed\n", key); 142 136 143 int iRet = fremovexattr(fd, key, options); 137 144 138 145 if(iRet < 0x00) 139 146 { 147 if(errno != ENOATTR) 148 fprintf(stderr, "ERROR: fremovexattr failed: %s\n", strerror(errno)); 149 140 150 bRet = 0x00; 141 151 } 142 152 }