* 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 <unistd.h>
-#include <fcntl.h>
+#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 <fcntl.h> /* for open() */
+#include <unistd.h> /* for close() */
struct split_args {
WIMStruct *w;
}
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;
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;