In the endless batch mode (-B), terminate if and when stdout is closed.

That mode is useful to call gstat from other app, however kinda useless
since gstat won't exit and stay running forever when its parent process
has long gone.

MFC after:	2 weeks
This commit is contained in:
Maxim Sobolev 2020-08-24 16:45:23 +00:00
parent 0e533c72bc
commit d065b3eb9e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=364711

View File

@ -517,7 +517,8 @@ main(int argc, char **argv)
if (!flag_B)
loop = 0;
else
fflush(stdout);
if (fflush(stdout) == EOF)
goto out;
usleep(flag_I);
continue;
}
@ -585,7 +586,7 @@ main(int argc, char **argv)
}
}
}
out:
if (!flag_b) {
el_end(el);
endwin();