]> wimlib.net Git - wimlib/blobdiff - src/mount_image.c
util.h: Use dummy_printf for DEBUG() and DEBUG2()
[wimlib] / src / mount_image.c
index ca490688658e867273720b021750a02b8af61527..839acbc86f51947378fcbd3aa0ec9884bf1755e9 100644 (file)
@@ -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;
 }