From ca5f355ad058159edac0eb398d7aa43b57bbddad Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 15 Sep 2008 14:37:17 +0200 Subject: Add mandatory open() attribute fixing some compilation errors open(2): "mode must be specified when O_CREAT is in the flags, and is ignored otherwise." --- libarchive/libarchive.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'libarchive/libarchive.c') diff --git a/libarchive/libarchive.c b/libarchive/libarchive.c index 462a030..ae7409e 100644 --- a/libarchive/libarchive.c +++ b/libarchive/libarchive.c @@ -1,5 +1,5 @@ /* libarchive plugin for Tux Commander - * version 0.0.6, designed for libarchive 2.5.5 + * version 0.0.7, designed for libarchive 2.5.5 * Copyright (C) 2008 Tomas Bzatek * Check for updates on tuxcmd.sourceforge.net * @@ -47,8 +47,8 @@ -#define VERSION "0.0.6" -#define BUILD_DATE "2008-08-21" +#define VERSION "0.0.7" +#define BUILD_DATE "2008-09-15" #define DEFAULT_BLOCK_SIZE 65536 @@ -491,7 +491,8 @@ my_archive_read_data_into_fd(struct archive *a, struct archive_entry *entry, con printf("(II) my_archive_read_data_into_fd: extracting to '%s', Append = %d\n", sDstName, Append); if (Append) fd = open(sDstName, O_APPEND | O_WRONLY); - else fd = open(sDstName, O_CREAT | O_WRONLY); + else fd = open(sDstName, O_CREAT | O_WRONLY | O_TRUNC, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if (fd < 0) { fprintf(stderr, "(EE) my_archive_read_data_into_fd: error occured while extracting data: %s\n", strerror(errno)); return cVFS_Failed; -- cgit v1.2.3