Normalize mkdir() error codes

This commit is contained in:
Justine Tunney 2021-01-29 19:49:34 -08:00
parent 6070319f84
commit bf8b1623c8
11 changed files with 206 additions and 25 deletions

View file

@ -21,6 +21,7 @@
#include "libc/calls/struct/dirent.h"
#include "libc/calls/struct/stat.h"
#include "libc/dce.h"
#include "libc/fmt/fmt.h"
#include "libc/log/check.h"
#include "libc/mem/mem.h"
#include "libc/runtime/gc.h"
@ -33,14 +34,11 @@
#include "libc/x/x.h"
uint64_t i;
char pathbuf[PATH_MAX];
const char *testdir, *oldpath;
char pathbuf[PATH_MAX], testdir[PATH_MAX], *oldpath;
void SetUp(void) {
mkdir("o", 0755);
mkdir("o/tmp", 0755);
testdir = xasprintf("o/tmp/%s.%d", program_invocation_short_name, getpid());
mkdir(testdir, 0755);
sprintf(testdir, "o/tmp/%s.%d", program_invocation_short_name, getpid());
makedirs(testdir, 0755);
CHECK_NE(-1, chdir(testdir));
mkdir("bin", 0755);
mkdir("home", 0755);