mirror of
https://github.com/cathery/sys-con.git
synced 2024-12-26 12:16:13 +00:00
Fix crash when config folder doesn't exist
This commit is contained in:
parent
f8b472fda9
commit
c9012b7c95
@ -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