summaryrefslogtreecommitdiff
path: root/lib/sqfs/write_xattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqfs/write_xattr.c')
-rw-r--r--lib/sqfs/write_xattr.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/sqfs/write_xattr.c b/lib/sqfs/write_xattr.c
index b6198b4..ab2e28c 100644
--- a/lib/sqfs/write_xattr.c
+++ b/lib/sqfs/write_xattr.c
@@ -30,10 +30,14 @@ static int get_prefix(const char *key)
}
}
- fprintf(stderr, "unknown xattr key '%s'\n", key);
return -1;
}
+bool sqfs_has_xattr(const char *key)
+{
+ return get_prefix(key) >= 0;
+}
+
static int write_pair(meta_writer_t *mw, const char *key, const char *value)
{
sqfs_xattr_entry_t kent;
@@ -41,8 +45,10 @@ static int write_pair(meta_writer_t *mw, const char *key, const char *value)
int type;
type = get_prefix(key);
- if (type < 0)
+ if (type < 0) {
+ fprintf(stderr, "unsupported xattr key '%s'\n", key);
return -1;
+ }
key = strchr(key, '.');
assert(key != NULL);