aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/main.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3d03bba..b2b3fe5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,7 +16,7 @@ target_link_libraries(msg markdown)
set(C_COMPILE_OPTIONS
# -O3
- -Og
+ -O0
-Wall
-Wextra
diff --git a/src/main.c b/src/main.c
index b42f5d7..d0c0596 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2,6 +2,7 @@
#include <copy.h>
#include <engine.h>
+#include <errno.h>
#include <filehandler.h>
#include <ftw.h>
#include <lexer.h>
@@ -15,8 +16,6 @@
#include "../config.h"
-void handle_file(const char *path);
-
char *base_pre;
char *base_post;
@@ -104,7 +103,12 @@ main(int argc, char **argv)
template_initialize(&base_pre, &base_post);
- mkdir(OUTPUT, 0700);
+ int err = mkdir(OUTPUT, 0700);
+ if (err != 0 && errno != EEXIST) {
+ perror("mkdir");
+ return EXIT_FAILURE;
+ }
+
nftw(
DIRECTORY "/" ASSETS, copy_recursively, 64, FTW_PHYS | FTW_ACTIONRETVAL);