22 lines
922 B
Diff
22 lines
922 B
Diff
We can't assign to *stdout and *stderr with musl libc
|
|
because both file pointers are const.
|
|
|
|
--- a/src/main.cc 2022-06-30 12:30:19.904327808 +0200
|
|
+++ b/src/main.cc 2022-06-30 12:30:57.351968860 +0200
|
|
@@ -315,2 +315,3 @@ void Application::init(int argc, char **
|
|
newfp = std::freopen((userStdPath + "/Output.log").c_str(), "w", stdout);
|
|
+#if defined(__GLIBC__)
|
|
if ( newfp == NULL ) { // This happens on NT
|
|
@@ -321,2 +322,3 @@ void Application::init(int argc, char **
|
|
}
|
|
+#endif
|
|
setvbuf(stdout, NULL, _IOLBF, BUFSIZ); // Line buffered
|
|
@@ -324,2 +326,3 @@ void Application::init(int argc, char **
|
|
newfp = std::freopen((userStdPath + "/Error.log").c_str(), "w", stderr);
|
|
+#if defined(__GLIBC__)
|
|
if ( newfp == NULL ) { // This happens on NT
|
|
@@ -330,2 +333,3 @@ void Application::init(int argc, char **
|
|
}
|
|
+#endif
|
|
setbuf(stderr, NULL); // No buffering
|