X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fmount_image.c;h=a17bf5026cc360c6491732d9d3a42ba15305b8b3;hb=8c26ca707e56d9848e52076ad3f7c26ea7fa338d;hp=ca490688658e867273720b021750a02b8af61527;hpb=10a87017a0a82d34ed3981e1f5e586b5b8613e3f;p=wimlib diff --git a/src/mount_image.c b/src/mount_image.c index ca490688..a17bf502 100644 --- a/src/mount_image.c +++ b/src/mount_image.c @@ -8,7 +8,7 @@ */ /* - * Copyright (C) 2012, 2013 Biggers + * Copyright (C) 2012, 2013 Eric Biggers * * This file is part of wimlib, a library for working with WIM files. * @@ -2115,7 +2115,6 @@ static int wimfs_setxattr(const char *path, const char *name, if (existing_ads_entry) { if (flags & XATTR_CREATE) return -EEXIST; - inode_remove_ads(inode, ads_idx, ctx->wim->lookup_table); } else { if (flags & XATTR_REPLACE) return -ENOATTR; @@ -2123,7 +2122,13 @@ static int wimfs_setxattr(const char *path, const char *name, ret = inode_add_ads_with_data(inode, name, (const u8*)value, size, ctx->wim->lookup_table); - return ret ? -ENOMEM : 0; + if (ret == 0) { + if (existing_ads_entry) + inode_remove_ads(inode, ads_idx, ctx->wim->lookup_table); + } else { + ret = -ENOMEM; + } + return ret; } #endif @@ -2620,8 +2625,12 @@ out: static inline int mount_unsupported_error() { +#if defined(__WIN32__) + ERROR("Sorry-- Mounting WIM images is not supported on Windows!"); +#else ERROR("wimlib was compiled with --without-fuse, which disables support " "for mounting WIMs."); +#endif return WIMLIB_ERR_UNSUPPORTED; }