]> wimlib.net Git - wimlib/commitdiff
wim.c: Remove reopen_wim(), close_wim()
authorEric Biggers <ebiggers3@gmail.com>
Tue, 14 Jan 2014 20:09:19 +0000 (14:09 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 14 Jan 2014 20:09:19 +0000 (14:09 -0600)
include/wimlib/wim.h
src/wim.c
src/write.c

index 3fdc7d2d28ab45cc6dd62f3269708f707aa1af4d..fa19c28dada89f34bdcdb094861255f93889e533 100644 (file)
@@ -142,9 +142,6 @@ for_image(WIMStruct *wim, int image, int (*visitor)(WIMStruct *));
 extern int
 wim_checksum_unhashed_streams(WIMStruct *wim);
 
 extern int
 wim_checksum_unhashed_streams(WIMStruct *wim);
 
-extern int
-reopen_wim(WIMStruct *wim);
-
 /* Internal open flags (pass to open_wim_as_WIMStruct(), not wimlib_open_wim())
  */
 #define WIMLIB_OPEN_FLAG_FROM_PIPE     0x80000000
 /* Internal open flags (pass to open_wim_as_WIMStruct(), not wimlib_open_wim())
  */
 #define WIMLIB_OPEN_FLAG_FROM_PIPE     0x80000000
index b36da84f2adb2196642d210c9436dfcd5a258f77..f118e793086774c289eddd9bbf607b0f5caefd9e 100644 (file)
--- a/src/wim.c
+++ b/src/wim.c
@@ -534,7 +534,7 @@ wimlib_set_output_pack_chunk_size(WIMStruct *wim, uint32_t chunk_size)
 }
 
 static int
 }
 
 static int
-do_open_wim(const tchar *filename, struct filedes *fd_ret)
+open_wim_file(const tchar *filename, struct filedes *fd_ret)
 {
        int raw_fd;
 
 {
        int raw_fd;
 
@@ -547,23 +547,6 @@ do_open_wim(const tchar *filename, struct filedes *fd_ret)
        return 0;
 }
 
        return 0;
 }
 
-int
-reopen_wim(WIMStruct *wim)
-{
-       wimlib_assert(!filedes_valid(&wim->in_fd));
-       return do_open_wim(wim->filename, &wim->in_fd);
-}
-
-int
-close_wim(WIMStruct *wim)
-{
-       if (filedes_valid(&wim->in_fd)) {
-               filedes_close(&wim->in_fd);
-               filedes_invalidate(&wim->in_fd);
-       }
-       return 0;
-}
-
 /*
  * Begins the reading of a WIM file; opens the file and reads its header and
  * lookup table, and optionally checks the integrity.
 /*
  * Begins the reading of a WIM file; opens the file and reads its header and
  * lookup table, and optionally checks the integrity.
@@ -582,7 +565,7 @@ begin_read(WIMStruct *wim, const void *wim_filename_or_fd,
                wim->in_fd.is_pipe = 1;
        } else {
                wimfile = wim_filename_or_fd;
                wim->in_fd.is_pipe = 1;
        } else {
                wimfile = wim_filename_or_fd;
-               ret = do_open_wim(wimfile, &wim->in_fd);
+               ret = open_wim_file(wimfile, &wim->in_fd);
                if (ret)
                        return ret;
 
                if (ret)
                        return ret;
 
index 63350bfc83bcaa8c61ca29a4bb6b688180c87f70..1df05c95402c7570802c6b2c6a3a83abe7b2aeee 100644 (file)
@@ -3123,7 +3123,10 @@ overwrite_wim_via_tmpfile(WIMStruct *wim, int write_flags,
                return ret;
        }
 
                return ret;
        }
 
-       close_wim(wim);
+       if (filedes_valid(&wim->in_fd)) {
+               filedes_close(&wim->in_fd);
+               filedes_invalidate(&wim->in_fd);
+       }
 
        /* Rename the new WIM file to the original WIM file.  Note: on Windows
         * this actually calls win32_rename_replacement(), not _wrename(), so
 
        /* Rename the new WIM file to the original WIM file.  Note: on Windows
         * this actually calls win32_rename_replacement(), not _wrename(), so