summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Wear <twear@codeaurora.org>2018-06-22 09:17:05 -0700
committerAmruth Ramachandran <amruthr@google.com>2018-06-26 13:07:35 +0000
commitf22064088b1538509e1f1f8cafd07ca3c13f00c9 (patch)
tree407e80532c3474d933f7efcdca9728dff496790d
parent3d55bd42a15bfe9c00bbb5b058255fa37fe571fd (diff)
downloadipacfg-mgr-f22064088b1538509e1f1f8cafd07ca3c13f00c9.tar.gz
ipacm: fix the err_type override issuepie-dr1-dev
Without ipacm-diag debug component, all the debug prints will have NOFILE err_type and overrides the kernel error codes. The fix is to cache it onve we got error from kernel. CRs-fixed: 2265427 Bug: 109872530 Test: VTS Test PASS. Basic live sanity with TMO Change-Id: I0cda8ae7a8075ef2f8caeead078296aa7e010e58
-rw-r--r--ipacm/src/IPACM_OffloadManager.cpp8
1 files changed, 4 insertions, 4 deletions
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::stopAllOffload()
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 @@ RET IPACM_OffloadManager::setQuota(const char * upstream_name /* upstream */, ui
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 {