1
0
mirror of https://github.com/cathery/sys-con.git synced 2024-11-16 14:09:51 +00:00

Fix crash when config folder doesn't exist

This commit is contained in:
cathery 2020-12-07 18:14:03 +03:00
parent 99f6f0c0c1
commit cf8d6d5b95
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,6 @@
#include "switch.h" #include "switch.h"
#include "log.h" #include "log.h"
#include "config_handler.h" #include <sys/stat.h>
#include <stratosphere.hpp> #include <stratosphere.hpp>
static ams::os::Mutex printMutex(false); static ams::os::Mutex printMutex(false);
@ -35,6 +35,8 @@ void WriteToLog(const char *fmt, ...)
ams::TimeSpan ts = ams::os::ConvertToTimeSpan(ams::os::GetSystemTick()); ams::TimeSpan ts = ams::os::ConvertToTimeSpan(ams::os::GetSystemTick());
mkdir(CONFIG_PATH, 777);
FILE *fp = fopen(LOG_PATH, "a"); FILE *fp = fopen(LOG_PATH, "a");
//Print time //Print time

View File

@ -1,4 +1,5 @@
#pragma once #pragma once
#include "config_handler.h"
#define LOG_PATH CONFIG_PATH "log.txt" #define LOG_PATH CONFIG_PATH "log.txt"