diff options
author | robertswiecki <robert@swiecki.net> | 2020-05-07 19:44:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-07 19:44:25 +0200 |
commit | 8087a7c6a88fa4aa7ee61ff694554966996743ec (patch) | |
tree | 027336f386ec79f4214032910a9aec67a0c1b129 | |
parent | 636474b7135ce264bb8cf7ded4580422d286adc3 (diff) | |
parent | d4e0b1f81f0125b31968a43aa79c50cc4d37f2bb (diff) | |
download | honggfuzz-8087a7c6a88fa4aa7ee61ff694554966996743ec.tar.gz |
Merge pull request #327 from jtpereyda/output-mkdir
make --output dir if it doesn't exist, as already done with -W
-rw-r--r-- | cmdline.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -259,6 +259,11 @@ static bool cmdlineVerify(honggfuzz_t* hfuzz) { return false; } + if (hfuzz->io.outputDir && mkdir(hfuzz->io.outputDir, 0700) == -1 && errno != EEXIST) { + PLOG_E("Couldn't create the output directory '%s'", hfuzz->io.outputDir); + return false; + } + if (strlen(hfuzz->io.workDir) == 0) { if (getcwd(hfuzz->io.workDir, sizeof(hfuzz->io.workDir)) == NULL) { PLOG_W("getcwd() failed. Using '.'"); |