tests: Use errno value rather than a specific int

For portability we use errno defines rather than explicit int values
when checking for errors.

Type: improvement
Change-Id: Ib5fc1db357da150d008d5a11bef5dbc7ec354cfb
Signed-off-by: Tom Jones <thj@freebsd.org>
This commit is contained in:
Tom Jones 2024-02-07 13:28:58 +00:00 committed by Ole Tr�an
parent b3ee84d0bb
commit 853cc9f2ad

View File

@ -6,6 +6,7 @@ import threading
import copy
import fcntl
import time
import errno
try:
import unittest2 as unittest
@ -55,7 +56,7 @@ class serverSocketThread(threading.Thread):
# Ethernet
self.rx_pkts.append(Ether(data[8:]))
except IOError as e:
if e.errno == 11:
if e.errno == errno.EAGAIN:
# nothing to receive, stop running or sleep a little
if self.stop_running:
break