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:
parent
99f6f0c0c1
commit
cf8d6d5b95
@ -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
|
||||||
|
@ -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"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user