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:
sobomax 2020-08-24 16:45:23 +00:00
parent 142e8d0ecd
commit cc4819ee34

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();