diff options
| author | Tomas Bzatek <tbzatek@tbzatek.englab.brq.redhat.com> | 2008-09-15 14:37:17 +0200 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@tbzatek.englab.brq.redhat.com> | 2008-09-15 14:37:17 +0200 |
| commit | ca5f355ad058159edac0eb398d7aa43b57bbddad (patch) | |
| tree | 4e8fe495ae38045897d857541c0757ffc21bfbde /libarchive/libarchive.c | |
| parent | 7da9e35bda21340ae65a8bd590ae675db9c62a44 (diff) | |
| download | tuxcmd-modules-ca5f355ad058159edac0eb398d7aa43b57bbddad.tar.xz | |
Add mandatory open() attribute fixing some compilation errorsv0.6.50release-0.6.50-dev
open(2): "mode must be specified when O_CREAT is in the flags, and is ignored otherwise."
Diffstat (limited to 'libarchive/libarchive.c')
| -rw-r--r-- | libarchive/libarchive.c | 9 |
1 files changed, 5 insertions, 4 deletions
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 <tbzatek@users.sourceforge.net> * 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; |
