some adjustments to previous file descriptor leak fix

This commit is contained in:
Axel Kohlmeyer
2013-12-16 06:43:18 +01:00
parent a153d3c16c
commit 8be1bf43db
2 changed files with 5 additions and 2 deletions

View File

@ -186,7 +186,10 @@ void Input::file()
if (n == 0) {
if (label_active) error->all(FLERR,"Label wasn't found in input script");
if (me == 0) {
if (infile != stdin) fclose(infile);
if (infile != stdin) {
fclose(infile);
infile = NULL;
}
nfile--;
}
MPI_Bcast(&nfile,1,MPI_INT,0,world);