Ticket #8484: patch-XASetOperation.c.diff
File patch-XASetOperation.c.diff, 1.2 KB (added by ulrich.kohlhase@…, 19 years ago) |
---|
-
XASetOperation.c
old new 12 12 #include <XAOperationInternal.h> 13 13 #include <unistd.h> 14 14 #include <stdio.h> 15 #include <errno.h> 15 16 #include <fcntl.h> 16 17 #include <string.h> 17 18 #include <mach/mach.h> 18 19 #include <sys/types.h> 19 20 #include <sys/stat.h> 20 21 #include "xattr.h" 21 #include <sys/xattr.h> 22 22 23 23 typedef struct __XASetOperation 24 24 { … … 225 225 226 226 Boolean XASetOperationPerform(XAOperationRef opaqueRef, int fd, CFStringRef path) 227 227 { 228 Boolean bRet = 0x0 0;228 Boolean bRet = 0x01; 229 229 230 230 XASetOperationRef operationRef = (XASetOperationRef)opaqueRef; 231 231 … … 241 241 242 242 if(CFStringGetCString(operationRef->key, key, bSize, kCFStringEncodingUTF8)) 243 243 { 244 size = fsetxattr(fd, key, (void *)bytes, size, position, options); 244 245 int fRet = fcntl(fd, F_NOCACHE, 0x01); 246 247 if(fRet < 0x00) 248 fprintf(stderr, "WARN: fcntl for key \"%s\" failed\n", key); 249 250 int iRet = fsetxattr(fd, key, (void *)bytes, size, position, options); 251 252 if(iRet < 0x00) 253 { 254 if(errno != EEXIST || errno != ENOATTR) 255 fprintf(stderr, "ERROR: fsetxattr failed: %s\n", strerror(errno)); 256 257 bRet = 0x00; 258 } 245 259 } 246 260 247 261 free(key);