]> wimlib.net Git - wimlib/blobdiff - src/mount.c
wimlib_export() updates
[wimlib] / src / mount.c
index 44dece2fdcfd3e71d7992dcabe27780b12dfc36d..478d1f643e63505b712f5b8d1dd1dce26316c6c2 100644 (file)
@@ -1738,6 +1738,12 @@ WIMLIBAPI int wimlib_mount(WIMStruct *wim, int image, const char *dir,
 
        DEBUG("Selected image %d", image);
 
+       if (imd->root_dentry->refcnt != 1) {
+               ERROR("Cannot mount image that was just exported with "
+                     "wimlib_export()");
+               return WIMLIB_ERR_INVALID_PARAM;
+       }
+
        next_ino = assign_inode_numbers(&imd->inode_list);
 
        DEBUG("(next_ino = %"PRIu64")", next_ino);