summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Pereyda <jtpereyda@users.noreply.github.com>2020-05-07 09:52:45 -0700
committerJoshua Pereyda <jtpereyda@users.noreply.github.com>2020-05-07 09:52:45 -0700
commitd4e0b1f81f0125b31968a43aa79c50cc4d37f2bb (patch)
treedea20f9b0506b03316a9a04f7336c7ce29c89df4
parentb6c48bc62551cd2e62b5f73af59d13fd453f1045 (diff)
downloadhonggfuzz-d4e0b1f81f0125b31968a43aa79c50cc4d37f2bb.tar.gz
make --output dir if it doesn't exist, as already done with -W
-rw-r--r--cmdline.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmdline.c b/cmdline.c
index 35d7ba74..5fa17e0b 100644
--- a/cmdline.c
+++ b/cmdline.c
@@ -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 '.'");