15:9a262e046ab8 | 16:bc9a0fefd892 |
---|---|
1 /* | |
2 * stream.c | |
3 * | |
4 * Created on: 20.09.2011 | |
5 * Author: beckermi | |
6 */ | |
7 | |
8 #include "stream.h" | |
9 | |
10 void close_stdout() { | |
11 #ifdef _WIN32 | |
12 _STREAM_STDOUT = dup(STDOUT_FILENO); | |
13 #endif | |
14 freopen("/dev/null", "w", stdout); | |
15 } | |
16 | |
17 void reopen_stdout() { | |
18 #ifdef _WIN32 | |
19 close(STDOUT_FILENO); | |
20 fdopen(dup(_STREAM_STDOUT), "wa"); | |
21 close(_STREAM_STDOUT); | |
22 #else | |
23 freopen("/dev/stdout", "w", stdout); | |
24 #endif | |
25 } |