From: Alan T. DeKok Date: Tue, 10 Jul 2018 14:22:30 +0000 (-0400) Subject: flush fp's after running the command X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e76eb760b799d985049a8bf8b627ec98a8a0fa8;p=thirdparty%2Ffreeradius-server.git flush fp's after running the command so that the output goes somewhere immediately --- diff --git a/src/main/radmin.c b/src/main/radmin.c index 809832e4303..3052acc7a1d 100644 --- a/src/main/radmin.c +++ b/src/main/radmin.c @@ -611,7 +611,7 @@ int fr_radmin_register(char const *name, void *ctx, fr_cmd_table_t *table) */ int fr_radmin_run(TALLOC_CTX *ctx, FILE *fp, FILE *fp_err, char const *command) { - int argc; + int argc, rcode; char *str; fr_cmd_info_t *info; @@ -631,11 +631,12 @@ int fr_radmin_run(TALLOC_CTX *ctx, FILE *fp, FILE *fp_err, char const *command) return 0; } - if (fr_command_run(fp, fp_err, info) < 0) { - talloc_free(info); - return -1; - } - + rcode = fr_command_run(fp, fp_err, info); + fflush(fp); + fflush(fp_err); talloc_free(info); + + if (rcode < 0) return rcode; + return 1; }