36 lines
1000 B
Diff
36 lines
1000 B
Diff
--- a/src/libraries/misc.h 2016-03-31 23:28:06.023869695 +0200
|
|
+++ b/src/libraries/misc.h 2016-03-31 23:28:12.069869242 +0200
|
|
@@ -30,6 +30,7 @@
|
|
#endif
|
|
|
|
#include "qingy_constants.h"
|
|
+#include <time.h>
|
|
|
|
/* Computes the integer part of the base 10 log */
|
|
int int_log10(int n);
|
|
--- a/src/libraries/vt.c 2016-03-31 23:33:35.641845025 +0200
|
|
+++ b/src/libraries/vt.c 2016-03-31 23:33:49.739843970 +0200
|
|
@@ -101,9 +101,9 @@ int switch_to_tty(int tty)
|
|
|
|
if (!ttyname) return 0;
|
|
/* we set stdin, stdout and stderr to the new tty */
|
|
- stdin = freopen(ttyname, "r", stdin);
|
|
- stdout = freopen(ttyname, "w", stdout);
|
|
- stderr = freopen(ttyname, "w", stderr);
|
|
+ freopen(ttyname, "r", stdin);
|
|
+ freopen(ttyname, "w", stdout);
|
|
+ freopen(ttyname, "w", stderr);
|
|
free(ttyname);
|
|
if (!stdin || !stdout || !stderr) return 0;
|
|
|
|
@@ -205,7 +205,7 @@ void stderr_enable(int *vt)
|
|
|
|
if (!ttyname) return;
|
|
|
|
- stderr = fopen(ttyname, "w");
|
|
+ freopen(ttyname, "w", stderr);
|
|
free(ttyname);
|
|
}
|
|
|
|
|