diff options
author | Joshua Pereyda <jtpereyda@users.noreply.github.com> | 2020-05-07 09:52:45 -0700 |
---|---|---|
committer | Joshua Pereyda <jtpereyda@users.noreply.github.com> | 2020-05-07 09:52:45 -0700 |
commit | d4e0b1f81f0125b31968a43aa79c50cc4d37f2bb (patch) | |
tree | dea20f9b0506b03316a9a04f7336c7ce29c89df4 | |
parent | b6c48bc62551cd2e62b5f73af59d13fd453f1045 (diff) | |
download | honggfuzz-d4e0b1f81f0125b31968a43aa79c50cc4d37f2bb.tar.gz |
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 '.'"); |