The issue was causing a high battery consumption on Android devices due to
the never blocking loop as a consequence of the CAWakeUpForChange() call.
Change-Id: Ifd4692074430e45b935e0b9c6b6fa4b41a9951f0
Signed-off-by: Tim Kourt <tim.a.kourt@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3903
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Naga Ashok Jampani <jn.ashok@samsung.com>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
{
(void)data;
OIC_LOG(DEBUG, TAG, "IN");
-
while (!caglobals.ip.terminate)
{
CAFindReadyMessage();
CAHandleNetlink();
break;
}
- else
+ else if (FD_ISSET(caglobals.ip.shutdownFds[0], readFds))
{
+ char buf[10];
+ (void)read(caglobals.ip.shutdownFds[0], buf, sizeof (buf));
CAInterface_t *ifchanged = CAFindInterfaceChange();
if (ifchanged)
{
}
break;
}
+ else
+ {
+ break;
+ }
(void)CAReceiveMessage(fd, flags);
FD_CLR(fd, readFds);