Skip to content

Commit

Permalink
Detect whether the underlying FS supports xattrs
Browse files Browse the repository at this point in the history
No support for xattrs is treated the same as a file having no xattrs on a
file system which does support xattrs. This should fix Debian BR #470184
  • Loading branch information
Alphix committed Mar 20, 2008
1 parent 8c886bd commit 84e8f95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions metaentry.c
Expand Up @@ -220,6 +220,10 @@ mentry_create(const char *path)


lsize = listxattr(path, NULL, 0); lsize = listxattr(path, NULL, 0);
if (lsize < 0) { if (lsize < 0) {
/* Perhaps the FS doesn't support xattrs? */
if (errno == ENOTSUP)
return mentry;

msg(MSG_ERROR, "listxattr failed for %s: %s\n", msg(MSG_ERROR, "listxattr failed for %s: %s\n",
path, strerror(errno)); path, strerror(errno));
return NULL; return NULL;
Expand Down
2 changes: 1 addition & 1 deletion metaentry.h
Expand Up @@ -18,7 +18,7 @@
* *
*/ */


/* Data structure to hold all metadata for a file */ /* Data structure to hold all metadata for a file/dir */
struct metaentry { struct metaentry {
struct metaentry *next; struct metaentry *next;
char *path; char *path;
Expand Down

0 comments on commit 84e8f95

Please sign in to comment.