diff options
| author | luwenpeng <[email protected]> | 2020-07-30 15:57:34 +0800 |
|---|---|---|
| committer | luwenpeng <[email protected]> | 2020-08-21 09:45:30 +0800 |
| commit | 13289d5a712ce5f91b3bc51187d11ce712335d5a (patch) | |
| tree | 0a4b159dc963de6418bb690e1347b3e1e6ef65a7 /plugin | |
| parent | 7e2f36d41639b6367b36b15a8b816a0e085ff80d (diff) | |
after log error, reset errno
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/business/traffic-mirror/src/ethdev.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/plugin/business/traffic-mirror/src/ethdev.cpp b/plugin/business/traffic-mirror/src/ethdev.cpp index 77b34f1..ed7bfee 100644 --- a/plugin/business/traffic-mirror/src/ethdev.cpp +++ b/plugin/business/traffic-mirror/src/ethdev.cpp @@ -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; } |
