Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,8 @@ int main(int argc, char *argv[]) {
}
(void)fflush(stdout);
(void)childx(ctx);
(void)sleep(RptTm);
if (!RptMaxCount || pr_count + 1 < RptMaxCount)
(void)sleep(RptTm);
Hdr = Nlproc = 0;
CkPasswd = 1;
}
Expand Down
17 changes: 17 additions & 0 deletions tests/case-20-repeat-count.bash
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,21 @@ if [ $(echo "$output" | grep -e "^p$$\$" | wc -l) != 2 ]; then
exit 1
fi

# The final pass must not wait for an interval before exiting.
if command -v python3 >/dev/null 2>&1; then
python3 - "$lsof" "$$" <<'PY' >> "$report" 2>&1 || exit 1
import subprocess
import sys

try:
result = subprocess.run([sys.argv[1], "-r30c1", "-p", sys.argv[2]],
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
timeout=5)
except subprocess.TimeoutExpired:
sys.exit("FAIL: lsof slept after its final repeat pass")
if result.returncode != 0 or result.stdout.count(b"=======") != 1:
sys.exit("FAIL: unexpected output or status from single repeat pass")
PY
fi

exit 0
Loading