When calculating the acctsize (the previous size of account file) via acctprocnt(), sometimes atop gets a wrong number of exited processes, which makes the 'nrprocs' input parameter for acctphotoproc() become a dummy huge value, like MAXACCTPROCS.
In this case, after acctphotoproc(), we get a wrong acctsize and then lseek() a wrong position via acctrepos().
To fix this, add a flag to prove the successful filling process info from accounting-record. Only the flag is true, do we make the calculation, which includes increasing nprocexit, accumulating the acctsize, and moving the struct tstat structure pointer forward.
When calculating the acctsize (the previous size of account file) via acctprocnt(), sometimes atop gets a wrong number of exited processes, which makes the 'nrprocs' input parameter for acctphotoproc() become a dummy huge value, like MAXACCTPROCS.
In this case, after acctphotoproc(), we get a wrong acctsize and then lseek() a wrong position via acctrepos().
To fix this, add a flag to prove the successful filling process info from accounting-record. Only the flag is true, do we make the calculation, which includes increasing nprocexit, accumulating the acctsize, and moving the struct tstat structure pointer forward.
Signed-off-by: Fei Li lifei.shirley@bytedance.com