diff options
author | Reuben Thomas <rrt@sc3d.org> | 2008-02-05 00:59:05 +0000 |
---|---|---|
committer | Reuben Thomas <rrt@sc3d.org> | 2008-02-05 00:59:05 +0000 |
commit | fcfb981a28bc5b22233da10742e547d1bb2cd795 (patch) | |
tree | ccec481a7bf1513baa2b9d6e00997b41584de416 | |
parent | dd74bdb48560800cfffa7c48cacc2c42a912588b (diff) | |
download | plptools-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.
-rw-r--r-- | plpfuse/fuse.c | 12 |
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) |