summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobertswiecki <robert@swiecki.net>2020-05-07 19:44:25 +0200
committerGitHub <noreply@github.com>2020-05-07 19:44:25 +0200
commit8087a7c6a88fa4aa7ee61ff694554966996743ec (patch)
tree027336f386ec79f4214032910a9aec67a0c1b129
parent636474b7135ce264bb8cf7ded4580422d286adc3 (diff)
parentd4e0b1f81f0125b31968a43aa79c50cc4d37f2bb (diff)
downloadhonggfuzz-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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmdline.c b/cmdline.c
index 0f7f8e88..c496ebee 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 '.'");