fix windows compat and some bugs

This commit is contained in:
2017-12-16 11:06:29 +01:00
parent 56a935cdd0
commit 62096da6e6
8 changed files with 28 additions and 4 deletions
-1
View File
@@ -238,7 +238,6 @@ static error_t close_conf(void *state)
ini_parse_end();
settings_read_ini_end();
// force a full remount to have the changes be visible
vfs_mngr_fs_remount(true);
return E_SUCCESS;
+2
View File
@@ -38,6 +38,8 @@
// TRANSFER_NOT_STARTED || TRASNFER_FINISHED
#define DISCONNECT_DELAY_MS 500
bool vfs_is_windows = false;
// Make sure none of the delays exceed the max time
COMPILER_ASSERT(CONNECT_DELAY_MS < MAX_EVENT_TIME_MS);
COMPILER_ASSERT(RECONNECT_DELAY_MS < MAX_EVENT_TIME_MS);
+2
View File
@@ -29,6 +29,8 @@
extern "C" {
#endif
extern bool vfs_is_windows;
/* Callable from anywhere */
// Enable or disable the virtual filesystem
+8
View File
@@ -23,6 +23,7 @@
#include "framework/settings.h"
#include "platform.h"
#include "vfs_manager.h"
#include "str_utils.h"
const vfs_filename_t daplink_drive_name = "VIRTUALFS";
@@ -67,6 +68,13 @@ void vfs_user_file_change_handler(const vfs_filename_t filename,
vfs_file_change_t change,
vfs_file_t file, vfs_file_t new_file_data)
{
if (strstarts(filename, "SYSTEM~1")) {
vfs_printf("ATENTION - we are dealing with windows! Careful or it will crash!");
// TODO take precautions
vfs_is_windows = true;
return;
}
if (VFS_FILE_CHANGED == change) {
// Unused
vfs_printf(">>> CHANGED %s", filename);