Commit d81324df authored by Tim Kientzle's avatar Tim Kientzle

Merge branch 'master' of github.com:libarchive/libarchive

parents 14144ae9 618bbab5
......@@ -3,18 +3,14 @@ sudo: true
compiler:
- gcc
- clang
env:
- BUILD_SYSTEM=cmake
- BUILD_SYSTEM=autotools
before_install:
- sudo add-apt-repository ppa:kubuntu-ppa/backports -y
- sudo apt-get update -qq
- if [ "${BUILD_SYSTEM}" = "cmake" ]; then sudo add-apt-repository ppa:kubuntu-ppa/backports -y; fi
- if [ "${BUILD_SYSTEM}" = "cmake" ]; then sudo apt-get update -qq; fi
install:
- sudo apt-get install -y cmake=2.8.12.2-0ubuntu1~ubuntu12.04.1~ppa2
- if [ "${BUILD_SYSTEM}" = "cmake" ]; then sudo apt-get install -y cmake=2.8.12.2-0ubuntu1~ubuntu12.04.1~ppa2; fi
- sudo apt-get install -y libbz2-dev libzip-dev liblzma-dev
before_script:
- BUILD_DIR=`pwd`/BUILD
- mkdir -p ${BUILD_DIR}
- cd ${BUILD_DIR}
- cmake ..
script:
- cd ${BUILD_DIR}
- make
- make test
- build/ci_build.sh
......@@ -662,6 +662,7 @@ libarchive_test_EXTRA_DIST=\
libarchive/test/test_read_filter_lrzip.tar.lrz.uu \
libarchive/test/test_read_filter_lzop.tar.lzo.uu \
libarchive/test/test_read_filter_lzop_multiple_parts.tar.lzo.uu \
libarchive/test/test_read_format_mtree_crash747.mtree.bz2.uu \
libarchive/test/test_read_format_7zip_bcj2_bzip2.7z.uu \
libarchive/test/test_read_format_7zip_bcj2_copy_1.7z.uu \
libarchive/test/test_read_format_7zip_bcj2_copy_2.7z.uu \
......@@ -787,6 +788,7 @@ libarchive_test_EXTRA_DIST=\
libarchive/test/test_read_format_zip_filename_utf8_jp.zip.uu \
libarchive/test/test_read_format_zip_filename_utf8_ru.zip.uu \
libarchive/test/test_read_format_zip_filename_utf8_ru2.zip.uu \
libarchive/test/test_read_format_zip_high_compression.zip.uu \
libarchive/test/test_read_format_zip_length_at_end.zip.uu \
libarchive/test/test_read_format_zip_mac_metadata.zip.uu \
libarchive/test/test_read_format_zip_malformed1.zip.uu \
......
#!/bin/sh
#
# Automated build and test of libarchive on CI systems
#
# Variables that can be passed via environment:
# BUILD_SYSTEM=
# BUILDDIR=
# SRCDIR=
# CONFIGURE_ARGS=
# MAKE_ARGS=
#
ACTIONS=
BUILD_SYSTEM="${BUILD_SYSTEM:-autotools}"
CURDIR=`pwd`
SRCDIR="${SRCDIR:-`pwd`}"
RET=0
usage () {
echo "Usage: $0 [-b autotools|cmake] [-a autogen|configure|build|test ] [ -a ... ] [ -d builddir ] [-s srcdir ]"
}
inputerror () {
echo $1
usage
exit 1
}
while getopts a:b:d:s: opt; do
case ${opt} in
a)
case "${OPTARG}" in
autogen) ;;
configure) ;;
build) ;;
test) ;;
*) inputerror "Invalid action (-a)" ;;
esac
ACTIONS="${ACTIONS} ${OPTARG}"
;;
b) BUILD_SYSTEM="${OPTARG}"
case "${BUILD_SYSTEM}" in
autotools) ;;
cmake) ;;
*) inputerror "Invalid build system (-b)" ;;
esac
;;
d)
BUILDDIR="${OPTARG}"
;;
s)
SRCDIR="${OPTARG}"
if [ ! -f "${SRCDIR}/build/version" ]; then
inputerror "Missing file: ${SRCDIR}/build/version"
fi
;;
esac
done
if [ -z "${ACTIONS}" ]; then
ACTIONS="autogen configure build test"
fi
if [ -z "${BUILD_SYSTEM}" ]; then
inputerror "Missing type (-t) parameter"
fi
if [ -z "${BUILDDIR}" ]; then
BUILDDIR="${CURDIR}/BUILD/${BUILD_SYSTEM}"
fi
mkdir -p "${BUILDDIR}"
for action in ${ACTIONS}; do
cd "${BUILDDIR}"
case "${action}" in
autogen)
case "${BUILD_SYSTEM}" in
autotools)
cd "${SRCDIR}"
sh build/autogen.sh
RET="$?"
;;
esac
;;
configure)
case "${BUILD_SYSTEM}" in
autotools) "${SRCDIR}/configure" ${CONFIGURE_ARGS} ;;
cmake) cmake ${CONFIGURE_ARGS} "${SRCDIR}" ;;
esac
RET="$?"
;;
build)
make ${MAKE_ARGS}
RET="$?"
;;
test)
case "${BUILD_SYSTEM}" in
autotools) make ${MAKE_ARGS} check ;;
cmake) make ${MAKE_ARGS} test ;;
esac
RET="$?"
;;
esac
if [ "${RET}" != "0" ]; then
exit "${RET}"
fi
cd "${CURDIR}"
done
exit "${RET}"
......@@ -1360,6 +1360,31 @@ assertion_file_birthtime_recent(const char *file, int line,
return assertion_file_time(file, line, pathname, 0, 0, 'b', 1);
}
/* Verify mode of 'pathname'. */
int
assertion_file_mode(const char *file, int line, const char *pathname, int expected_mode)
{
int mode;
int r;
assertion_count(file, line);
#if defined(_WIN32) && !defined(__CYGWIN__)
failure_start(file, line, "assertFileMode not yet implemented for Windows");
#else
{
struct stat st;
r = lstat(pathname, &st);
mode = (int)(st.st_mode & 0777);
}
if (r == 0 && mode == expected_mode)
return (1);
failure_start(file, line, "File %s has mode %o, expected %o",
pathname, mode, expected_mode);
#endif
failure_finish(NULL);
return (0);
}
/* Verify mtime of 'pathname'. */
int
assertion_file_mtime(const char *file, int line,
......@@ -1578,8 +1603,12 @@ assertion_make_dir(const char *file, int line, const char *dirname, int mode)
if (0 == _mkdir(dirname))
return (1);
#else
if (0 == mkdir(dirname, mode))
return (1);
if (0 == mkdir(dirname, mode)) {
if (0 == chmod(dirname, mode)) {
assertion_file_mode(file, line, dirname, mode);
return (1);
}
}
#endif
failure_start(file, line, "Could not create directory %s", dirname);
failure_finish(NULL);
......@@ -1628,6 +1657,11 @@ assertion_make_file(const char *file, int line,
failure_finish(NULL);
return (0);
}
if (0 != chmod(path, mode)) {
failure_start(file, line, "Could not chmod %s", path);
failure_finish(NULL);
return (0);
}
if (contents != NULL) {
ssize_t wsize;
......@@ -1644,6 +1678,7 @@ assertion_make_file(const char *file, int line,
}
}
close(fd);
assertion_file_mode(file, line, path, mode);
return (1);
#endif
}
......
......@@ -241,6 +241,7 @@ int assertion_file_birthtime_recent(const char *, int, const char *);
int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
int assertion_file_contents(const char *, int, const void *, int, const char *);
int assertion_file_exists(const char *, int, const char *);
int assertion_file_mode(const char *, int, const char *, int);
int assertion_file_mtime(const char *, int, const char *, long, long);
int assertion_file_mtime_recent(const char *, int, const char *);
int assertion_file_nlinks(const char *, int, const char *, int);
......
......@@ -12,7 +12,7 @@ m4_define([BSDTAR_VERSION_S],LIBARCHIVE_VERSION_S())
m4_define([BSDCPIO_VERSION_S],LIBARCHIVE_VERSION_S())
m4_define([BSDCAT_VERSION_S],LIBARCHIVE_VERSION_S())
AC_PREREQ([2.69])
AC_PREREQ([2.68])
#
# Now starts the "real" configure script.
......
......@@ -130,6 +130,13 @@ __FBSDID("$FreeBSD: src/usr.bin/cpio/test/main.c,v 1.3 2008/08/24 04:58:22 kient
# include <crtdbg.h>
#endif
mode_t umasked(mode_t expected_mode)
{
mode_t mode = umask(0);
umask(mode);
return expected_mode & ~mode;
}
/* Path to working directory for current test */
const char *testworkdir;
#ifdef PROGRAM
......@@ -1294,6 +1301,11 @@ assertion_file_time(const char *file, int line,
switch (type) {
case 'a': filet_nsec = st.st_atimespec.tv_nsec; break;
case 'b': filet = st.st_birthtime;
/* FreeBSD filesystems that don't support birthtime
* (e.g., UFS1) always return -1 here. */
if (filet == -1) {
return (1);
}
filet_nsec = st.st_birthtimespec.tv_nsec; break;
case 'm': filet_nsec = st.st_mtimespec.tv_nsec; break;
default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
......@@ -1361,6 +1373,31 @@ assertion_file_birthtime_recent(const char *file, int line,
return assertion_file_time(file, line, pathname, 0, 0, 'b', 1);
}
/* Verify mode of 'pathname'. */
int
assertion_file_mode(const char *file, int line, const char *pathname, int expected_mode)
{
int mode;
int r;
assertion_count(file, line);
#if defined(_WIN32) && !defined(__CYGWIN__)
failure_start(file, line, "assertFileMode not yet implemented for Windows");
#else
{
struct stat st;
r = lstat(pathname, &st);
mode = (int)(st.st_mode & 0777);
}
if (r == 0 && mode == expected_mode)
return (1);
failure_start(file, line, "File %s has mode %o, expected %o",
pathname, mode, expected_mode);
#endif
failure_finish(NULL);
return (0);
}
/* Verify mtime of 'pathname'. */
int
assertion_file_mtime(const char *file, int line,
......@@ -1400,7 +1437,7 @@ assertion_file_nlinks(const char *file, int line,
assertion_count(file, line);
r = lstat(pathname, &st);
if (r == 0 && (int)st.st_nlink == nlinks)
return (1);
return (1);
failure_start(file, line, "File %s has %d links, expected %d",
pathname, st.st_nlink, nlinks);
failure_finish(NULL);
......@@ -1579,8 +1616,12 @@ assertion_make_dir(const char *file, int line, const char *dirname, int mode)
if (0 == _mkdir(dirname))
return (1);
#else
if (0 == mkdir(dirname, mode))
return (1);
if (0 == mkdir(dirname, mode)) {
if (0 == chmod(dirname, mode)) {
assertion_file_mode(file, line, dirname, mode);
return (1);
}
}
#endif
failure_start(file, line, "Could not create directory %s", dirname);
failure_finish(NULL);
......@@ -1629,6 +1670,12 @@ assertion_make_file(const char *file, int line,
failure_finish(NULL);
return (0);
}
if (0 != chmod(path, mode)) {
failure_start(file, line, "Could not chmod %s", path);
failure_finish(NULL);
close(fd);
return (0);
}
if (contents != NULL) {
ssize_t wsize;
......@@ -1641,10 +1688,12 @@ assertion_make_file(const char *file, int line,
failure_start(file, line,
"Could not write to %s", path);
failure_finish(NULL);
close(fd);
return (0);
}
}
close(fd);
assertion_file_mode(file, line, path, mode);
return (1);
#endif
}
......
......@@ -182,6 +182,8 @@
assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
#define assertFileSize(pathname, size) \
assertion_file_size(__FILE__, __LINE__, pathname, size)
#define assertFileMode(pathname, mode) \
assertion_file_mode(__FILE__, __LINE__, pathname, mode)
#define assertTextFileContents(text, pathname) \
assertion_text_file_contents(__FILE__, __LINE__, text, pathname)
#define assertFileContainsLinesAnyOrder(pathname, lines) \
......@@ -241,6 +243,7 @@ int assertion_file_birthtime_recent(const char *, int, const char *);
int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
int assertion_file_contents(const char *, int, const void *, int, const char *);
int assertion_file_exists(const char *, int, const char *);
int assertion_file_mode(const char *, int, const char *, int);
int assertion_file_mtime(const char *, int, const char *, long, long);
int assertion_file_mtime_recent(const char *, int, const char *);
int assertion_file_nlinks(const char *, int, const char *, int);
......@@ -326,6 +329,9 @@ void copy_reference_file(const char *);
*/
void extract_reference_files(const char **);
/* Subtract umask from mode */
mode_t umasked(mode_t expected_mode);
/* Path to working directory for current test */
extern const char *testworkdir;
......
......@@ -222,7 +222,6 @@ static void
create(const char *filename, int compress, const char **argv)
{
struct archive *a;
struct archive *disk;
struct archive_entry *entry;
ssize_t len;
int fd;
......@@ -253,12 +252,11 @@ create(const char *filename, int compress, const char **argv)
filename = NULL;
archive_write_open_filename(a, filename);
disk = archive_read_disk_new();
#ifndef NO_LOOKUP
archive_read_disk_set_standard_lookup(disk);
#endif
while (*argv != NULL) {
struct archive *disk = archive_read_disk_new();
#ifndef NO_LOOKUP
archive_read_disk_set_standard_lookup(disk);
#endif
int r;
r = archive_read_disk_open(disk, *argv);
......
......@@ -628,7 +628,6 @@ translate_acl(struct archive_read_disk *a,
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Unknown ACL brand");
return (ARCHIVE_WARN);
break;
}
#endif
......
......@@ -232,6 +232,7 @@ static const char *
lookup_uname_helper(struct name_cache *cache, id_t id)
{
struct passwd *result;
(void)cache; /* UNUSED */
result = getpwuid((uid_t)id);
......@@ -298,6 +299,7 @@ static const char *
lookup_gname_helper(struct name_cache *cache, id_t id)
{
struct group *result;
(void)cache; /* UNUSED */
result = getgrgid((gid_t)id);
......
......@@ -128,6 +128,13 @@ __FBSDID("$FreeBSD: head/lib/libarchive/test/main.c 201247 2009-12-30 05:59:21Z
# include <crtdbg.h>
#endif
mode_t umasked(mode_t expected_mode)
{
mode_t mode = umask(0);
umask(mode);
return expected_mode & ~mode;
}
/* Path to working directory for current test */
const char *testworkdir;
#ifdef PROGRAM
......@@ -1364,6 +1371,31 @@ assertion_file_birthtime_recent(const char *file, int line,
return assertion_file_time(file, line, pathname, 0, 0, 'b', 1);
}
/* Verify mode of 'pathname'. */
int
assertion_file_mode(const char *file, int line, const char *pathname, int expected_mode)
{
int mode;
int r;
assertion_count(file, line);
#if defined(_WIN32) && !defined(__CYGWIN__)
failure_start(file, line, "assertFileMode not yet implemented for Windows");
#else
{
struct stat st;
r = lstat(pathname, &st);
mode = (int)(st.st_mode & 0777);
}
if (r == 0 && mode == expected_mode)
return (1);
failure_start(file, line, "File %s has mode %o, expected %o",
pathname, mode, expected_mode);
#endif
failure_finish(NULL);
return (0);
}
/* Verify mtime of 'pathname'. */
int
assertion_file_mtime(const char *file, int line,
......@@ -1403,7 +1435,7 @@ assertion_file_nlinks(const char *file, int line,
assertion_count(file, line);
r = lstat(pathname, &st);
if (r == 0 && (int)st.st_nlink == nlinks)
return (1);
return (1);
failure_start(file, line, "File %s has %d links, expected %d",
pathname, st.st_nlink, nlinks);
failure_finish(NULL);
......@@ -1440,31 +1472,6 @@ assertion_file_size(const char *file, int line, const char *pathname, long size)
return (0);
}
/* Verify mode of 'pathname'. */
int
assertion_file_mode(const char *file, int line, const char *pathname, int expected_mode)
{
int mode;
int r;
assertion_count(file, line);
#if defined(_WIN32) && !defined(__CYGWIN__)
failure_start(file, line, "assertFileMode not yet implemented for Windows");
#else
{
struct stat st;
r = lstat(pathname, &st);
mode = (int)(st.st_mode & 0777);
}
if (r == 0 && mode == expected_mode)
return (1);
failure_start(file, line, "File %s has mode %o, expected %o",
pathname, mode, expected_mode);
#endif
failure_finish(NULL);
return (0);
}
/* Assert that 'pathname' is a dir. If mode >= 0, verify that too. */
int
assertion_is_dir(const char *file, int line, const char *pathname, int mode)
......@@ -1607,8 +1614,12 @@ assertion_make_dir(const char *file, int line, const char *dirname, int mode)
if (0 == _mkdir(dirname))
return (1);
#else
if (0 == mkdir(dirname, mode))
return (1);
if (0 == mkdir(dirname, mode)) {
if (0 == chmod(dirname, mode)) {
assertion_file_mode(file, line, dirname, mode);
return (1);
}
}
#endif
failure_start(file, line, "Could not create directory %s", dirname);
failure_finish(NULL);
......@@ -1657,6 +1668,12 @@ assertion_make_file(const char *file, int line,
failure_finish(NULL);
return (0);
}
if (0 != chmod(path, mode)) {
failure_start(file, line, "Could not chmod %s", path);
failure_finish(NULL);
close(fd);
return (0);
}
if (contents != NULL) {
ssize_t wsize;
......@@ -1669,10 +1686,12 @@ assertion_make_file(const char *file, int line,
failure_start(file, line,
"Could not write to %s", path);
failure_finish(NULL);
close(fd);
return (0);
}
}
close(fd);
assertion_file_mode(file, line, path, mode);
return (1);
#endif
}
......
......@@ -243,12 +243,12 @@ int assertion_file_birthtime_recent(const char *, int, const char *);
int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
int assertion_file_contents(const char *, int, const void *, int, const char *);
int assertion_file_exists(const char *, int, const char *);
int assertion_file_mode(const char *, int, const char *, int);
int assertion_file_mtime(const char *, int, const char *, long, long);
int assertion_file_mtime_recent(const char *, int, const char *);
int assertion_file_nlinks(const char *, int, const char *, int);
int assertion_file_not_exists(const char *, int, const char *);
int assertion_file_size(const char *, int, const char *, long);
int assertion_file_mode(const char *, int, const char *, int);
int assertion_is_dir(const char *, int, const char *, int);
int assertion_is_hardlink(const char *, int, const char *, const char *);
int assertion_is_not_hardlink(const char *, int, const char *, const char *);
......@@ -329,6 +329,9 @@ void copy_reference_file(const char *);
*/
void extract_reference_files(const char **);
/* Subtract umask from mode */
mode_t umasked(mode_t expected_mode);
/* Path to working directory for current test */
extern const char *testworkdir;
......
......@@ -93,7 +93,7 @@ static struct myacl_t acls_reg[] = {
static struct myacl_t acls_dir[] = {
/* For this test, we need to be able to read and write the ACL. */
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_ACL,
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_READ_ACL,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, ""},
/* An entry for each type. */
......
......@@ -200,14 +200,24 @@ DEFINE_TEST(test_read_append_filter_wrong_program)
{
struct archive_entry *ae;
struct archive *a;
FILE * fp;
int fd;
fpos_t pos;
/*
* If we have "bunzip2 -q", try using that.
*/
if (!canRunCommand("bunzip2 -V")) {
if (!canRunCommand("bunzip2 -h")) {
skipping("Can't run bunzip2 program on this platform");
return;
}
/* bunzip2 will write to stderr, redirect it to a file */
fflush(stderr);
fgetpos(stderr, &pos);
fd = dup(fileno(stderr));
fp = freopen("stderr1", "w", stderr);
assert((a = archive_read_new()) != NULL);
assertA(0 == archive_read_set_format(a, ARCHIVE_FORMAT_TAR));
assertEqualIntA(a, ARCHIVE_OK,
......@@ -217,4 +227,15 @@ DEFINE_TEST(test_read_append_filter_wrong_program)
assertA(archive_read_next_header(a, &ae) < (ARCHIVE_WARN));
assertEqualIntA(a, ARCHIVE_WARN, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
/* restore stderr */
if (fp != NULL) {
fflush(stderr);
dup2(fd, fileno(stderr));
close(fd);
clearerr(stderr);
fsetpos(stderr, &pos);
}
assertTextFileContents("bunzip2: (stdin) is not a bzip2 file.\n", "stderr1");
}
......@@ -84,6 +84,7 @@ add_substitution(struct bsdtar *bsdtar, const char *rule_text)
if (rule == NULL)
lafe_errc(1, errno, "Out of memory");
rule->next = NULL;
rule->result = NULL;
if (subst->last_rule == NULL)
subst->first_rule = rule;
......
......@@ -130,6 +130,13 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/test/main.c,v 1.6 2008/11/05 06:40:53 kientz
# include <crtdbg.h>
#endif
mode_t umasked(mode_t expected_mode)
{
mode_t mode = umask(0);
umask(mode);
return expected_mode & ~mode;
}
/* Path to working directory for current test */
const char *testworkdir;
#ifdef PROGRAM
......@@ -1157,6 +1164,35 @@ assertion_file_contains_lines_any_order(const char *file, int line,
return (0);
}
/* Verify that a text file does not contains the specified strings */
int
assertion_file_contains_no_invalid_strings(const char *file, int line,
const char *pathname, const char *strings[])
{
char *buff;
int i;
buff = slurpfile(NULL, "%s", pathname);
if (buff == NULL) {
failure_start(file, line, "Can't read file: %s", pathname);
failure_finish(NULL);
return (0);
}
for (i = 0; strings[i] != NULL; ++i) {
if (strstr(buff, strings[i]) != NULL) {
failure_start(file, line, "Invalid string in %s: %s", pathname,
strings[i]);
failure_finish(NULL);
free(buff);
return(0);
}
}
free(buff);
return (0);
}
/* Test that two paths point to the same file. */
/* As a side-effect, asserts that both files exist. */
static int
......@@ -1294,6 +1330,11 @@ assertion_file_time(const char *file, int line,
switch (type) {
case 'a': filet_nsec = st.st_atimespec.tv_nsec; break;
case 'b': filet = st.st_birthtime;
/* FreeBSD filesystems that don't support birthtime
* (e.g., UFS1) always return -1 here. */
if (filet == -1) {
return (1);
}
filet_nsec = st.st_birthtimespec.tv_nsec; break;
case 'm': filet_nsec = st.st_mtimespec.tv_nsec; break;
default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
......@@ -1361,6 +1402,31 @@ assertion_file_birthtime_recent(const char *file, int line,
return assertion_file_time(file, line, pathname, 0, 0, 'b', 1);
}
/* Verify mode of 'pathname'. */
int
assertion_file_mode(const char *file, int line, const char *pathname, int expected_mode)
{
int mode;
int r;
assertion_count(file, line);
#if defined(_WIN32) && !defined(__CYGWIN__)
failure_start(file, line, "assertFileMode not yet implemented for Windows");
#else
{
struct stat st;
r = lstat(pathname, &st);
mode = (int)(st.st_mode & 0777);
}
if (r == 0 && mode == expected_mode)
return (1);
failure_start(file, line, "File %s has mode %o, expected %o",
pathname, mode, expected_mode);
#endif
failure_finish(NULL);
return (0);
}
/* Verify mtime of 'pathname'. */
int
assertion_file_mtime(const char *file, int line,
......@@ -1400,7 +1466,7 @@ assertion_file_nlinks(const char *file, int line,
assertion_count(file, line);
r = lstat(pathname, &st);
if (r == 0 && (int)st.st_nlink == nlinks)
return (1);
return (1);
failure_start(file, line, "File %s has %d links, expected %d",
pathname, st.st_nlink, nlinks);
failure_finish(NULL);
......@@ -1579,8 +1645,12 @@ assertion_make_dir(const char *file, int line, const char *dirname, int mode)
if (0 == _mkdir(dirname))
return (1);
#else
if (0 == mkdir(dirname, mode))
return (1);
if (0 == mkdir(dirname, mode)) {
if (0 == chmod(dirname, mode)) {
assertion_file_mode(file, line, dirname, mode);
return (1);
}
}
#endif