Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 109584 Details for
Bug 165989
xfce-extra/xfce4-battery-0.5.0: No display of temperature or fan status
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed bugfix (patch for panel-plugin/libacpi.c)
batt.patch (text/plain), 1.30 KB, created by
Ulrich Müller
on 2007-02-08 20:50:36 UTC
(
hide
)
Description:
Proposed bugfix (patch for panel-plugin/libacpi.c)
Filename:
MIME Type:
Creator:
Ulrich Müller
Created:
2007-02-08 20:50:36 UTC
Size:
1.30 KB
patch
obsolete
>--- panel-plugin/libacpi.c~ 2007-02-08 21:45:19.000000000 +0100 >+++ panel-plugin/libacpi.c 2007-02-08 21:45:26.000000000 +0100 >@@ -30,6 +30,7 @@ > #include <stdlib.h> > #include <sys/types.h> > #include <dirent.h> >+#include <glob.h> > > #if HAVE_SYSCTL > >@@ -181,6 +182,22 @@ > #endif > #endif > >+/* expand file name and fopen first match */ >+static FILE * >+fopen_glob(const char *name, const char *mode) >+{ >+ glob_t globbuf; >+ FILE *fd; >+ >+ if (glob(name, 0, NULL, &globbuf) != 0) >+ return NULL; >+ >+ fd = fopen(globbuf.gl_pathv[0], mode); >+ globfree(&globbuf); >+ >+ return fd; >+} >+ > /* see if we have ACPI support */ > int check_acpi(void) > { >@@ -693,7 +710,7 @@ > else return 0; > } > proc_fan_status="/proc/acpi/fan/*/state"; >- if ( (fp=fopen(proc_fan_status, "r")) == NULL ) return 0; >+ if ( (fp=fopen_glob(proc_fan_status, "r")) == NULL ) return 0; > > fgets(line,255,fp); > fclose(fp); >@@ -706,10 +723,10 @@ > { > #ifdef __linux__ > FILE *fp; >- char *proc_temperature="/proc/acpi/thermal_zone/*0/temperature"; >+ char *proc_temperature="/proc/acpi/thermal_zone/*/temperature"; > static char *p,line[256]; > >- if ( (fp=fopen(proc_temperature, "r")) == NULL) return NULL; >+ if ( (fp=fopen_glob(proc_temperature, "r")) == NULL) return NULL; > fgets(line,255,fp); > fclose(fp); > p=strtok(line," ");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 165989
: 109584