]> wimlib.net Git - wimlib/blobdiff - src/resource.c
capture_ntfs_streams(): Set 'ret' properly
[wimlib] / src / resource.c
index 73f860eb4d4bd559de6fc6be70dc4cc5585729a2..8c88129626795b3a3a2c0e76f17c6a66b56cfd1a 100644 (file)
@@ -463,7 +463,7 @@ put_resource_entry(void *p, const struct resource_entry *entry)
 static FILE *
 wim_get_fp(WIMStruct *w)
 {
-#ifdef WITH_FUSE
+#if defined(WITH_FUSE) || defined(ENABLE_MULTITHREADED_COMPRESSION)
        pthread_mutex_lock(&w->fp_tab_mutex);
        FILE *fp;
 
@@ -482,9 +482,9 @@ wim_get_fp(WIMStruct *w)
                ERROR_WITH_ERRNO("Failed to open `%"TS"'", w->filename);
 out_unlock:
        pthread_mutex_unlock(&w->fp_tab_mutex);
-#else /* WITH_FUSE */
+#else /* WITH_FUSE || ENABLE_MULTITHREADED_COMPRESSION */
        fp = w->fp;
-#endif /* !WITH_FUSE */
+#endif /* !WITH_FUSE && !ENABLE_MULTITHREADED_COMPRESSION */
        return fp;
 }
 
@@ -492,7 +492,7 @@ static int
 wim_release_fp(WIMStruct *w, FILE *fp)
 {
        int ret = 0;
-#ifdef WITH_FUSE
+#if defined(WITH_FUSE) || defined(ENABLE_MULTITHREADED_COMPRESSION)
        FILE **fp_tab;
 
        pthread_mutex_lock(&w->fp_tab_mutex);
@@ -516,7 +516,7 @@ wim_release_fp(WIMStruct *w, FILE *fp)
        w->num_allocated_fps += 4;
 out_unlock:
        pthread_mutex_unlock(&w->fp_tab_mutex);
-#endif /* WITH_FUSE */
+#endif /* WITH_FUSE || ENABLE_MULTITHREADED_COMPRESSION */
        return ret;
 }
 
@@ -630,6 +630,7 @@ read_wim_resource_prefix(const struct wim_lookup_table_entry *lte,
 }
 
 
+#ifndef __WIN32__
 static int
 read_file_on_disk_prefix(const struct wim_lookup_table_entry *lte,
                         u64 size,
@@ -676,6 +677,7 @@ out_close:
        close(fd);
        return ret;
 }
+#endif /* !__WIN32__ */
 
 static int
 read_buffer_prefix(const struct wim_lookup_table_entry *lte,
@@ -732,7 +734,9 @@ read_resource_prefix(const struct wim_lookup_table_entry *lte,
 {
        static const read_resource_prefix_handler_t handlers[] = {
                [RESOURCE_IN_WIM]             = read_wim_resource_prefix,
+       #ifndef __WIN32__
                [RESOURCE_IN_FILE_ON_DISK]    = read_file_on_disk_prefix,
+       #endif
                [RESOURCE_IN_ATTACHED_BUFFER] = read_buffer_prefix,
        #ifdef WITH_FUSE
                [RESOURCE_IN_STAGING_FILE]    = read_file_on_disk_prefix,
@@ -808,8 +812,8 @@ extract_wim_resource(const struct wim_lookup_table_entry *lte,
                                print_lookup_table_entry(lte, stderr);
                                if (lte->resource_location == RESOURCE_IN_WIM)
                                        ERROR("The WIM file appears to be corrupt!");
-                               ret = WIMLIB_ERR_INVALID_RESOURCE_HASH;
                        #endif
+                               ret = WIMLIB_ERR_INVALID_RESOURCE_HASH;
                        }
                }
        } else {