aboutsummaryrefslogtreecommitdiffstats
path: root/plpfuse
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2008-02-05 00:59:05 +0000
committerReuben Thomas <rrt@sc3d.org>2008-02-05 00:59:05 +0000
commitfcfb981a28bc5b22233da10742e547d1bb2cd795 (patch)
treeccec481a7bf1513baa2b9d6e00997b41584de416 /plpfuse
parentdd74bdb48560800cfffa7c48cacc2c42a912588b (diff)
downloadplptools-fcfb981a28bc5b22233da10742e547d1bb2cd795.tar.gz
plptools-fcfb981a28bc5b22233da10742e547d1bb2cd795.tar.bz2
plptools-fcfb981a28bc5b22233da10742e547d1bb2cd795.zip
Fix a bug in xattr conversion to EPOC attributes.
When asked for non-existent xattrs, fail silently, for a better user experience.
Diffstat (limited to 'plpfuse')
-rw-r--r--plpfuse/fuse.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/plpfuse/fuse.c b/plpfuse/fuse.c
index 3cce988..876b629 100644
--- a/plpfuse/fuse.c
+++ b/plpfuse/fuse.c
@@ -66,9 +66,9 @@ xattr2pattr(long *psisattr, long *psidattr, const char *oxattr, const char *nxat
}
if ((strchr(oxattr, 'h') == NULL) != (strchr(nxattr, 'h') == NULL)) { /* h = hidden */
if (strchr(nxattr, 'h'))
- *psidattr |= PSI_A_HIDDEN;
- else
*psisattr |= PSI_A_HIDDEN;
+ else
+ *psidattr |= PSI_A_HIDDEN;
}
if ((strchr(oxattr, 's') == NULL) != (strchr(nxattr, 's') == NULL)) { /* s = system */
if (strchr(nxattr, 's'))
@@ -427,7 +427,7 @@ static int plp_chmod(const char *path, mode_t mode)
static int plp_getxattr(const char *path, const char *name, char *value, size_t size)
{
- debuglog("plp_getxattr `%s'", ++path);
+ debuglog("plp_getxattr `%s' %s", ++path, name);
if (strcmp(name, XATTR_NAME) == 0) {
if (size >= XATTR_MAXLEN) {
long pattr, psize, ptime;
@@ -440,10 +440,8 @@ static int plp_getxattr(const char *path, const char *name, char *value, size_t
debuglog("only gave %d bytes, need %d", size, XATTR_MAXLEN);
return XATTR_MAXLEN;
}
- } else {
- errno = ENOATTR;
- return -1;
- }
+ }
+ return 0;
}
static int plp_setxattr(const char *path, const char *name, const char *value, size_t size, int flags)