diff --git a/src/engine/linux/debug.cpp b/src/engine/linux/debug.cpp index 009299a61..78bbeabf2 100644 --- a/src/engine/linux/debug.cpp +++ b/src/engine/linux/debug.cpp @@ -19,7 +19,7 @@ namespace Debug void debugOutput(const char* message) { - puts(message); + printf("%s", message); } diff --git a/src/engine/linux/fibers.cpp b/src/engine/linux/fibers.cpp index 71a5f6908..7618f5178 100644 --- a/src/engine/linux/fibers.cpp +++ b/src/engine/linux/fibers.cpp @@ -1,5 +1,6 @@ #include "engine/fibers.h" #include "engine/lumix.h" +#include "engine/profiler.h" #include #include #include @@ -48,6 +49,7 @@ void destroy(Handle fiber) void switchTo(Handle* prev, Handle fiber) { + Profiler::beforeFiberSwitch(); swapcontext(prev, &fiber); } diff --git a/src/engine/linux/os.cpp b/src/engine/linux/os.cpp index e0888537d..a3109c30c 100644 --- a/src/engine/linux/os.cpp +++ b/src/engine/linux/os.cpp @@ -278,7 +278,7 @@ static void processEvents() void destroyWindow(WindowHandle window) { - ASSERT(false); + //ASSERT(false); // TODO } @@ -661,9 +661,22 @@ void unclipCursor() bool copyFile(const char* from, const char* to) { - ////ASSERT(false); - // TODO - return {}; + const int source = open(from, O_RDONLY, 0); + if (source < 0) return false; + const int dest = open(to, O_WRONLY | O_CREAT, 0644); + if (dest < 1) { + close(source); + return false; + } + + char buf[BUFSIZ]; + size_t size; + while ((size = read(source, buf, BUFSIZ)) > 0) { + write(dest, buf, size); + } + + close(source); + close(dest); }