On Fri, 11 Nov 2022 11:05:24 +0300 Andrew Rybchenko <andrew.rybche...@oktetlabs.ru> wrote:
> It looks wrong to skip pmd_test_exit() in periodic stats > case (if body above). Earlier it happened in signal handler. > IMHO, pmd_test_exit() should be done just before pdump > uninit below (outside if/else bodies (and removed from > interactive == 1 branch above). > > > + if (rc < 0) > > + return 1; > > It took some time for me to understand what's happening here. > Finally I came to conclusion that it just preserve previous > behaviour to return with failure code immediately if read > fails. Except addition of pmd_test_exit() above. > I think it is a wrong behaviour to skip all cleanup which > is done below, but I agree that it is a separate issue to > fix. > > > + prompt_exit(); > > prompt_exit() is registered as atexit() callback and if I'm not > mistakes will be called anyway. Good catch. Trying to unwind the intentions of earlier code here. Next version should be cleaner.