mirror of
https://github.com/gtxaspec/wz_mini_hacks.git
synced 2025-08-08 03:24:03 +00:00
rtsp fixes
This commit is contained in:
18
libcallback_wz_mod/freopen.c
Normal file
18
libcallback_wz_mod/freopen.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <stdio.h>
|
||||
#include <dlfcn.h>
|
||||
#include <string.h>
|
||||
|
||||
static FILE * (*original_freopen)(const char *pathname, const char *mode, FILE *stream);
|
||||
|
||||
static void __attribute ((constructor)) freopen_hook_init(void) {
|
||||
|
||||
original_freopen = dlsym(dlopen ("/lib/libc.so.0", RTLD_LAZY), "freopen");
|
||||
}
|
||||
|
||||
FILE *freopen(const char *pathname, const char *mode, FILE *stream) {
|
||||
|
||||
if(stream == stdout) return stdout;
|
||||
return original_freopen(pathname, mode, stream);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user