diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-05-31 13:59:08 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-05-31 13:59:08 -0300 |
commit | ca4b95e91b33e5b8f02a063862359ab00c5260d5 (patch) | |
tree | 872d6a54fa0e59e017aa3101880d82f0e54fb70a /extra/icewm/icewm-cpustatus.patch | |
parent | 041ebdb9062909e39f81cca8c491c7f8adeed2a3 (diff) | |
parent | 2ed96c6eb798c762b61a93a8b4cf80220c00ac1f (diff) |
Merge branch 'master' of ssh://vparabola/home/parabola/abslibre-pre-mips64el
Conflicts:
community-testing/libvirt/PKGBUILD
community/opendkim/opendkim.rc
core/nfs-utils/blkmapd.service
multilib/lib32-glib2/PKGBUILD
multilib/lib32-libssh2/PKGBUILD
multilib/lib32-libx11/PKGBUILD
multilib/lib32-qt/PKGBUILD
testing/php/PKGBUILD
testing/xorg-server/PKGBUILD
~fauno/notmuch/PKGBUILD
Diffstat (limited to 'extra/icewm/icewm-cpustatus.patch')
-rw-r--r-- | extra/icewm/icewm-cpustatus.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/extra/icewm/icewm-cpustatus.patch b/extra/icewm/icewm-cpustatus.patch new file mode 100644 index 000000000..9bb9241f0 --- /dev/null +++ b/extra/icewm/icewm-cpustatus.patch @@ -0,0 +1,45 @@ + icewm/src/acpustatus.cc | 31 +++++++++++++++++++++++++++++++ + 1 files changed, 31 insertions(+), 0 deletions(-) + +diff --git a/icewm/src/acpustatus.cc b/icewm/src/acpustatus.cc +index 5e959d6..b9e5450 100644 +--- a/icewm/src/acpustatus.cc ++++ b/icewm/src/acpustatus.cc +@@ -315,6 +315,37 @@ int CPUStatus::getAcpiTemp(char *tempbuf, int buflen) { + } + closedir(dir); + } ++ else if ((dir = opendir("/sys/class/thermal")) != NULL) { ++ struct dirent *de; ++ ++ while ((de = readdir(dir)) != NULL) { ++ ++ int fd, seglen; ++ ++ if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0) ++ continue; ++ ++ sprintf(namebuf, "/sys/class/thermal/%s/temp", de->d_name); ++ fd = open(namebuf, O_RDONLY); ++ if (fd != -1) { ++ int len = read(fd, buf, sizeof(buf) - 1); ++ buf[len - 4] = '\0'; ++ seglen = strlen(buf) + 4; ++ if (retbuflen + seglen >= buflen) { ++ retbuflen = -retbuflen; ++ close(fd); ++ closedir(dir); ++ break; ++ } ++ retbuflen += seglen; ++ strcat(tempbuf, " "); ++ strncat(tempbuf, buf, seglen); ++ strcat(tempbuf, " C"); ++ close(fd); ++ } ++ } ++ closedir(dir); ++ } + return retbuflen; + } + |