]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
flush fp's after running the command
authorAlan T. DeKok <aland@freeradius.org>
Tue, 10 Jul 2018 14:22:30 +0000 (10:22 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 10 Jul 2018 14:22:30 +0000 (10:22 -0400)
so that the output goes somewhere immediately

src/main/radmin.c

index 809832e430396e99c261e692b87e60aecf19a8c9..3052acc7a1d03e1b4f65280b020925f191d37517 100644 (file)
@@ -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;
 }