X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fmount_image.c;h=839acbc86f51947378fcbd3aa0ec9884bf1755e9;hb=811a38dfe05ef337e2d627f654f8a3e559900790;hp=ca490688658e867273720b021750a02b8af61527;hpb=10a87017a0a82d34ed3981e1f5e586b5b8613e3f;p=wimlib diff --git a/src/mount_image.c b/src/mount_image.c index ca490688..839acbc8 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(__CYGWIN__) || 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; }