Thomas Renninger wrote:
Anton Farygin wrote:

On Fri, 02 Sep 2005 15:59:08 +0200, Danny Kukawka wrote:

On Friday 02 September 2005 15:24, Anton Farygin wrote:

i compile current powersave CVS (HEAD) for ALT Linux Sisyphus and see
error (gcc 3.4):
g++ -Wall -DHAVE_SYSLOG_H -DDEBUG -g -O2 -o .libs/powersaved acpi.o
apm.o config_pm.o cpufreq.o cpufreq_userspace.o cpufreq_kernel.o event.o
general_config.o powersaved.o scheme_config.o clientConnection.o
event_management.o stringutil.o dbus_server.o brightness.o
../libpower/.libs/libpowersave.so
../libpower/.libs/libpowersave_clientsocket.so
../libpower/.libs/libpowersave_dbus.so -Wl,--rpath -Wl,/usr/local/lib
cpufreq_userspace.o(.text+0x24f): In function
`CPUFreq_Userspace::initFreqsViaFile()':
/usr/lib/gcc/i586-alt-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_
string.h:1456: undefined reference to `read_line(char const*, char*,
unsigned int)'

After moving inline functions body to cpufreq.h - powersave daemon
compliled without a errors.

This is correct ?

Which state of the CVS?


HEAD

Did the CVS from tag VERSION_10_10_0 works for
you? If not, pleas send a patch with the changes. Thanks.


may be VERSION_0_10_10 ?

Permissions denied for anonymous :-(

$ cvs up -rVERSION_0_10_10
Password: cvs [server aborted]: cannot write /cvsroot/powersave/CVSROOT/val-tags: Permission denied

What the ... is that?
Anonymous user cannot checkout TAGS?

Yes.

We need to assign a bug to the forge project ...

Could you please send a patch for HEAD then. There shouldn't be any changes in this area recently.

attached.

Rgds,
Anton
Index: daemon/cpufreq.cpp
===================================================================
RCS file: /cvsroot/powersave/powersave/daemon/cpufreq.cpp,v
retrieving revision 1.34
diff -u -r1.34 cpufreq.cpp
--- daemon/cpufreq.cpp  19 Aug 2005 19:15:19 -0000      1.34
+++ daemon/cpufreq.cpp  2 Sep 2005 14:50:46 -0000
@@ -34,62 +34,6 @@
 string CPUFreq_Interface::POWERSAVE_STRING   = "powersave";
 string CPUFreq_Interface::PERFORMANCE_STRING = "performance";
 
-/***** H E L P E R   F U N C T I O N S *********************/
-/** @brief read a line from a file */
-inline 
-int read_line(const char * filename, char * line, unsigned len)
-{
-       FILE * fp = fopen(filename, "r");
-       if (!fp){
-               pDebug(DBG_ERR, "Could not open file for reading: '%s'", 
filename);
-               return -1;
-       }
-       if ( (!fgets(line, len, fp)) ){
-               pDebug(DBG_ERR, "Could not read from file: '%s'", filename);
-               fclose(fp);
-               return -1;
-       }
-       fclose(fp);
-       return 1;
-}
-//governor
-
-/** @brief write a line to a file */
-inline 
-int write_line(const char * filename, const char *fmt, ...)
-{
-       FILE * fp = fopen(filename, "w+");
-       if (!fp){
-               //          pDebug(DBG_ERR, "Could not open file for writing: 
%s; %s", filename, strerror(errno));
-               return -1;
-       }
-       va_list ap;
-       va_start(ap, fmt);         // get variable argument list passed
-       if (vfprintf(fp, fmt, ap) < 0){
-               //          pDebug(DBG_ERR, "Could not write to file: %s", 
filename);
-               fclose (fp);
-               return -1;
-       }
-       va_end(ap);
-       fclose(fp);
-       return 1;
-}
-
-/** @brief read an integer value from a file, error is 0!!! */
-inline
-unsigned read_value(const char * filename)
-{
-       char line[MAX_LINE_SIZE];
-       if (read_line(filename, line, sizeof line) < 0){
-               pDebug(DBG_ERR, "Could not read value in file %s: error: 
%s!\n", filename, strerror(errno));
-               return 0;
-       }
-       else {
-               pDebug(DBG_INFO, "Value: %s read out from file: %s!\n", line, 
filename);
-               return atoi(line);
-       }
-}
-/***** H E L P E R   F U N C T I O N S *********************/
 
 
 CPUFreq_Interface::CPUFreq_Interface(int sysfs, int cpu){
Index: daemon/cpufreq.h
===================================================================
RCS file: /cvsroot/powersave/powersave/daemon/cpufreq.h,v
retrieving revision 1.15
diff -u -r1.15 cpufreq.h
--- daemon/cpufreq.h    19 Aug 2005 19:15:19 -0000      1.15
+++ daemon/cpufreq.h    2 Sep 2005 14:50:46 -0000
@@ -28,9 +28,60 @@
 
 
 /***** H E L P E R   F U N C T I O N S *********************/
-int read_line(const char * filename, char * line, unsigned len);
-int write_line(const char * filename, const char *fmt, ...);
-unsigned read_value(const char * filename);
+/** @brief read a line from a file */
+inline
+int read_line(const char * filename, char * line, unsigned len)
+{
+       FILE * fp = fopen(filename, "r");
+       if (!fp){
+               pDebug(DBG_ERR, "Could not open file for reading: '%s'", 
filename);
+               return -1;
+       }
+       if ( (!fgets(line, len, fp)) ){
+               pDebug(DBG_ERR, "Could not read from file: '%s'", filename);
+               fclose(fp);
+               return -1;
+       }
+       fclose(fp);
+       return 1;
+}
+//governor
+
+/** @brief write a line to a file */
+inline
+int write_line(const char * filename, const char *fmt, ...)
+{
+       FILE * fp = fopen(filename, "w+");
+       if (!fp){
+               //          pDebug(DBG_ERR, "Could not open file for writing: 
%s; %s", filename, strerror(errno));
+               return -1;
+       }
+       va_list ap;
+       va_start(ap, fmt);         // get variable argument list passed
+       if (vfprintf(fp, fmt, ap) < 0){
+               //          pDebug(DBG_ERR, "Could not write to file: %s", 
filename);
+               fclose (fp);
+               return -1;
+       }
+       va_end(ap);
+       fclose(fp);
+       return 1;
+}
+
+/** @brief read an integer value from a file, error is 0!!! */
+inline
+unsigned read_value(const char * filename)
+{
+       char line[MAX_LINE_SIZE];
+       if (read_line(filename, line, sizeof line) < 0){
+               pDebug(DBG_ERR, "Could not read value in file %s: error: 
%s!\n", filename, strerror(errno));
+               return 0;
+       }
+       else {
+               pDebug(DBG_INFO, "Value: %s read out from file: %s!\n", line, 
filename);
+               return atoi(line);
+       }
+}
 /***** H E L P E R   F U N C T I O N S *********************/
 
 class CPUFreq_Kernel;
_______________________________________________
powersave-devel mailing list
[email protected]
http://forge.novell.com/mailman/listinfo/powersave-devel

Reply via email to