|
@@ -144,12 +144,7 @@ int main(int argc, char *argv[])
|
|
|
sigaction(SIGCHLD, &sa, NULL); // ignores child process termination
|
|
|
sigaction(0, &sa, NULL); // ignores shell termination
|
|
|
|
|
|
-/* pfd[0].fd = open("/sys/gfa/tiva/UVers", O_RDONLY, 0);
|
|
|
- pfd[1].fd = open("/sys/gfa/tiva/UBatV3", O_RDONLY, 0);
|
|
|
- pfd[2].fd = open("/sys/gfa/tiva/Temp", O_RDONLY, 0);
|
|
|
- pfd[3].fd = open("/sys/gfa/tiva/UV5Vsys", O_RDONLY, 0);
|
|
|
- pfd[4].fd = open("/sys/gfa/tiva/UV3V6Bat", O_RDONLY, 0);
|
|
|
- pfd[5].fd = open("/sys/gfa/tiva/TempTIVA", O_RDONLY, 0);*/
|
|
|
+ /////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
for(i = 0, nCntAtts = 0; i < (int)_countof(attribs); ++i)
|
|
|
{
|
|
@@ -157,7 +152,7 @@ int main(int argc, char *argv[])
|
|
|
char szDevNode[128];
|
|
|
sprintf(szDevNode, "/sys/gfa/tiva/%s", attribs[i].pszName);
|
|
|
|
|
|
- if((fd = open(szDevNode, O_RDONLY, 0)))
|
|
|
+ if((fd = open(szDevNode, O_RDONLY, 0)) >= 0)
|
|
|
{
|
|
|
pfd[nCntAtts].fd = fd;
|
|
|
pfd[nCntAtts].events = POLLPRI;
|