summaryrefslogtreecommitdiffstats
path: root/Utilities/cmtar/libtar.c
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmtar/libtar.c')
-rw-r--r--Utilities/cmtar/libtar.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Utilities/cmtar/libtar.c b/Utilities/cmtar/libtar.c
index 362c105..b19d043 100644
--- a/Utilities/cmtar/libtar.c
+++ b/Utilities/cmtar/libtar.c
@@ -99,8 +99,13 @@ static int libtar_gzopen(void* call_data, const char *pathname,
return -1;
}
-#if !defined(_WIN32) || defined(__CYGWIN__)
- if ((oflags & O_CREAT) && fchmod(fd, mode))
+#if defined(__BEOS__) && !defined(__ZETA__) // no fchmod on BeOS...do pathname instead.
+ if ((oflags & O_CREAT) && chmod(pathname, mode & 07777))
+ {
+ return -1;
+ }
+#elif !defined(_WIN32) || defined(__CYGWIN__)
+ if ((oflags & O_CREAT) && fchmod(fd, mode & 07777))
{
return -1;
}