ipacm: fix the err_type override issue am: f22064088b
am: 03e44a691e
Change-Id: I2962acdd63f915b15cb189270c54abff3ef5eb04
diff --git a/ipacm/src/IPACM_OffloadManager.cpp b/ipacm/src/IPACM_OffloadManager.cpp
index 5efe20f..571df8a 100644
--- a/ipacm/src/IPACM_OffloadManager.cpp
+++ b/ipacm/src/IPACM_OffloadManager.cpp
@@ -573,7 +573,7 @@
RET IPACM_OffloadManager::setQuota(const char * upstream_name /* upstream */, uint64_t mb/* limit */)
{
wan_ioctl_set_data_quota quota;
- int fd = -1,rc = 0;
+ int fd = -1, rc = 0, err_type = 0;
if ((fd = open(DEVICE_NAME, O_RDWR)) < 0)
{
@@ -597,10 +597,10 @@
if(rc != 0)
{
+ err_type = errno;
close(fd);
- IPACMERR("IOCTL WAN_IOCTL_SET_DATA_QUOTA call failed: %s rc: %d\n", strerror(errno),rc);
- if (errno == ENODEV) {
- IPACMDBG_H("Invalid argument.\n");
+ IPACMERR("IOCTL WAN_IOCTL_SET_DATA_QUOTA call failed: %s err_type: %d\n", strerror(errno), err_type);
+ if (err_type == ENODEV) {
return FAIL_UNSUPPORTED;
}
else {