Skip to content

Commit e14bf34

Browse files
pkt-gen: exit on poll error
1 parent 1912c67 commit e14bf34

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

apps/pkt-gen/pkt-gen.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,6 +1649,14 @@ receiver_body(void *data)
16491649
i = poll(&pfd, 1, 1000);
16501650
if (i > 0 && !(pfd.revents & POLLERR))
16511651
break;
1652+
if (i < 0) {
1653+
D("poll() error: %s", strerror(errno));
1654+
goto quit;
1655+
}
1656+
if (pfd.revents & POLLERR) {
1657+
D("fd error");
1658+
goto quit;
1659+
}
16521660
RD(1, "waiting for initial packets, poll returns %d %d",
16531661
i, pfd.revents);
16541662
}

0 commit comments

Comments
 (0)