X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fsplit.c;h=05a7beebd9585b2d4141b26b4e284c881103feea;hb=2e44f90c21db693058037f83f92ad136c818ce9d;hp=47168c8f379b549258b43eb890d05e61ae7a4e79;hpb=4f953b223bed60d71a7689d414ccb5cc60be537f;p=wimlib diff --git a/src/split.c b/src/split.c index 47168c8f..05a7beeb 100644 --- a/src/split.c +++ b/src/split.c @@ -23,12 +23,22 @@ * along with wimlib; if not, see http://www.gnu.org/licenses/. */ -#include "wimlib_internal.h" -#include "lookup_table.h" -#include "xml.h" -#include "buffer_io.h" -#include -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib.h" +#include "wimlib/buffer_io.h" +#include "wimlib/error.h" +#include "wimlib/file_io.h" +#include "wimlib/lookup_table.h" +#include "wimlib/metadata.h" +#include "wimlib/types.h" +#include "wimlib/write.h" +#include "wimlib/list.h" + +#include /* for open() */ +#include /* for close() */ struct split_args { WIMStruct *w; @@ -60,9 +70,9 @@ finish_swm(WIMStruct *w, struct list_head *lte_list, } static int -copy_resource_to_swm(struct wim_lookup_table_entry *lte, void *__args) +copy_resource_to_swm(struct wim_lookup_table_entry *lte, void *_args) { - struct split_args *args = (struct split_args*)__args; + struct split_args *args = (struct split_args*)_args; WIMStruct *w = args->w; int ret; @@ -225,8 +235,8 @@ wimlib_split(WIMStruct *w, const tchar *swm_name, part_name = swm_base_name; } - part_fd = topen(part_name, O_WRONLY); - if (part_fd == INVALID_FILEDES) { + part_fd = topen(part_name, O_WRONLY | O_BINARY); + if (part_fd == -1) { ERROR_WITH_ERRNO("Failed to open `%"TS"'", part_name); ret = WIMLIB_ERR_OPEN; goto out;