mirror of
https://github.com/cathery/sys-con.git
synced 2024-12-25 09:14:35 +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 "log.h"
|
||||
#include "config_handler.h"
|
||||
#include <sys/stat.h>
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
static ams::os::Mutex printMutex(false);
|
||||
@ -35,6 +35,8 @@ void WriteToLog(const char *fmt, ...)
|
||||
|
||||
ams::TimeSpan ts = ams::os::ConvertToTimeSpan(ams::os::GetSystemTick());
|
||||
|
||||
mkdir(CONFIG_PATH, 777);
|
||||
|
||||
FILE *fp = fopen(LOG_PATH, "a");
|
||||
|
||||
//Print time
|
||||
|
@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include "config_handler.h"
|
||||
|
||||
#define LOG_PATH CONFIG_PATH "log.txt"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user