mirror of
https://github.com/springzfx/cgproxy.git
synced 2026-03-15 09:32:09 +08:00
flush fprintf
This commit is contained in:
@@ -44,7 +44,10 @@ bool loadExecsnoopLib() {
|
||||
}
|
||||
info("dlsym startThread success");
|
||||
return true;
|
||||
} catch (exception &e) { return false; }
|
||||
} catch (exception &e) {
|
||||
debug("exception: %s",e.what());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} // namespace CGPROXY::EXECSNOOP
|
||||
|
||||
@@ -253,7 +256,6 @@ public:
|
||||
execsnoop_thread_id = startExecsnoopThread();
|
||||
if (execsnoop_thread_id > 0) info("execsnoop thread started");
|
||||
}
|
||||
cout << flush;
|
||||
|
||||
pthread_join(socket_thread_id, NULL);
|
||||
pthread_join(execsnoop_thread_id, NULL);
|
||||
@@ -295,7 +297,6 @@ void processArgs(const int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
setbuf(stdout, NULL);
|
||||
processArgs(argc, argv);
|
||||
if (print_help) {
|
||||
print_usage();
|
||||
|
||||
@@ -46,6 +46,7 @@ extern bool enable_info;
|
||||
fprintf(stderr, "error: "); \
|
||||
fprintf(stderr, __VA_ARGS__); \
|
||||
fprintf(stderr, "\n"); \
|
||||
fflush(stderr); \
|
||||
}
|
||||
|
||||
#define debug(...) \
|
||||
@@ -53,6 +54,7 @@ extern bool enable_info;
|
||||
fprintf(stdout, "debug: "); \
|
||||
fprintf(stdout, __VA_ARGS__); \
|
||||
fprintf(stdout, "\n"); \
|
||||
fflush(stdout); \
|
||||
}
|
||||
|
||||
#define info(...) \
|
||||
@@ -60,6 +62,7 @@ extern bool enable_info;
|
||||
fprintf(stdout, "info: "); \
|
||||
fprintf(stdout, __VA_ARGS__); \
|
||||
fprintf(stdout, "\n"); \
|
||||
fflush(stdout); \
|
||||
}
|
||||
|
||||
#define return_error return -1
|
||||
|
||||
Reference in New Issue
Block a user