Flush output streams. Do not fclose stdout/stdin.
This commit is contained in:
@ -757,6 +757,7 @@ int main(int argc, char** argv) {
|
||||
fprintf(stderr, "hackrf_exit() done\n");
|
||||
}
|
||||
|
||||
fflush(outfile);
|
||||
if ( ( outfile != NULL ) && ( outfile != stdout ) ) {
|
||||
fclose(outfile);
|
||||
outfile = NULL;
|
||||
|
@ -1141,9 +1141,14 @@ int main(int argc, char** argv) {
|
||||
rewind(file);
|
||||
fwrite(&wave_file_hdr, 1, sizeof(t_wav_file_hdr), file);
|
||||
}
|
||||
fclose(file);
|
||||
file = NULL;
|
||||
fprintf(stderr, "fclose(file) done\n");
|
||||
if (file != stdin) {
|
||||
fflush(file);
|
||||
}
|
||||
if ((file != stdout) && (file != stdin)) {
|
||||
fclose(file);
|
||||
file = NULL;
|
||||
fprintf(stderr, "fclose() done\n");
|
||||
}
|
||||
}
|
||||
fprintf(stderr, "exit\n");
|
||||
return exit_code;
|
||||
|
Reference in New Issue
Block a user