after log error, reset errno

This commit is contained in:
luwenpeng
2020-07-30 15:57:34 +08:00
parent 7e2f36d416
commit 13289d5a71
10 changed files with 103 additions and 5 deletions

View File

@@ -214,6 +214,8 @@ struct traffic_mirror_ethdev * traffic_mirror_ethdev_pcap_create(const char * st
if(fd < 0)
{
TFE_LOG_ERROR(logger, "failed at create socket: %s", strerror(errno));
/* after log, reset errno */
errno = 0;
goto errout;
}
@@ -223,6 +225,8 @@ struct traffic_mirror_ethdev * traffic_mirror_ethdev_pcap_create(const char * st
if(ioctl(fd, SIOCGIFHWADDR, &if_req) < 0)
{
TFE_LOG_ERROR(logger, "failed at read hwaddr of device %s: %s", str_ethdev, strerror(errno));
/* after log, reset errno */
errno = 0;
goto errout;
}
@@ -238,6 +242,8 @@ struct traffic_mirror_ethdev * traffic_mirror_ethdev_pcap_create(const char * st
if (ioctl(fd, SIOCGIFMTU, &if_req) < 0)
{
TFE_LOG_ERROR(logger, "failed at read mtu of device %s: %s", str_ethdev, strerror(errno));
/* after log, reset errno */
errno = 0;
goto errout;
}