From b6df1b22ab6f4bf4844008dd0282fa91ef9a9de4 Mon Sep 17 00:00:00 2001 From: Maciej Fijalkowski Date: Tue, 14 May 2013 23:55:27 +0200 Subject: [PATCH] flush the pypy debug file --- plugins/pypy/pypy_plugin.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/pypy/pypy_plugin.c b/plugins/pypy/pypy_plugin.c index bb5aa7c0..cea45974 100644 --- a/plugins/pypy/pypy_plugin.c +++ b/plugins/pypy/pypy_plugin.c @@ -12,6 +12,7 @@ struct uwsgi_pypy uwsgi_pypy_settings = { char* rpython_startup_code(); int pypy_setup_home(char *homedir, int verbose); int pypy_execute_source(char *source); +extern FILE* pypy_debug_file; extern struct uwsgi_server uwsgi; @@ -62,6 +63,12 @@ void uwsgi_dummy_preinit_apps() // this is a placeholder so function does not stay empty } +void uwsgi_pypy_atexit() +{ + if (pypy_debug_file) + fflush(pypy_debug_file); +} + struct uwsgi_option uwsgi_pypy_options[] = { {"pypy-home", required_argument, 0, "set the home of pypy library (required)", uwsgi_opt_set_str, &uwsgi_pypy_settings.homedir, 0}, @@ -80,4 +87,5 @@ struct uwsgi_plugin pypy_plugin = { .options = uwsgi_pypy_options, .init_apps = uwsgi_dummy_init_apps, .preinit_apps = uwsgi_dummy_preinit_apps, + .atexit = uwsgi_pypy_atexit, };