dav/libxattr.c

changeset 369
4322b8953bd5
parent 364
3769ba002fd1
child 379
cdaf5a3d3a50
equal deleted inserted replaced
368:11797f33bc24 369:4322b8953bd5
337 *len = (ssize_t)bufsize; 337 *len = (ssize_t)bufsize;
338 return buf; 338 return buf;
339 } 339 }
340 340
341 int xattr_set(const char *path, const char *name, const void *value, size_t len) { 341 int xattr_set(const char *path, const char *name, const void *value, size_t len) {
342 int attrfile = open_attrfile(path, name, O_CREAT|O_WRONLY|O_XATTR); 342 int attrfile = open_attrfile(path, name, O_CREAT|O_WRONLY|O_XATTR|O_TRUNC);
343 if(attrfile == -1) { 343 if(attrfile == -1) {
344 return -1; 344 return -1;
345 } 345 }
346 346
347 const char *p = value; 347 const char *p = value;

mercurial