[xiph-cvs] cvs commit: mgm/modules/linux battery

Monty xiphmont at xiph.org
Mon Apr 23 10:34:50 PDT 2001



xiphmont    01/04/23 10:34:50

  Modified:    modules/linux battery
  Log:
  Oooops.
  
  There were two battery bugs after all.  I did break PC APM support,
  and coming out of suspend would make MGM hesitate occasionally as the
  pmu daemon's timing changes after a suspend for some odd reason.
  
  Monty

Revision  Changes    Path
1.8       +15 -2     mgm/modules/linux/battery

Index: battery
===================================================================
RCS file: /usr/local/cvsroot/mgm/modules/linux/battery,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- battery	2001/04/22 21:50:05	1.7
+++ battery	2001/04/23 17:34:50	1.8
@@ -97,8 +97,18 @@
              "G4/NewWorld/iBook",
              "newer than Titanium");
 
-# Mac style power management
 sub read_proc{
+    my$test;
+    my$this=shift;
+
+    if($openp){return $this->read_proc_mac;}
+    $test=$this->read_proc_apm;
+    if(defined($test)){return $test;}
+    return $this->read_proc_mac;
+}
+
+# Mac style power management
+sub read_proc_mac{
     my $percent;
     my $line;
 
@@ -119,6 +129,8 @@
                   SWITCH:{
                       if($1>=10 && $1<=12){
                           $openp=$1;
+			  my$foo="\n";
+			  syswrite B_FD,$foo,1;
                           last SWITCH;
                       }
                       print "PowerMac PMU version $1 (".
@@ -132,7 +144,6 @@
     }
     
     if($openp){
-	syswrite B_FD,"\n",1;
         if($openp>=10 && $openp<=12){
             sysread B_FD,$line,1024;
             $line=~m/^S\s+\{([^\}]*)\}\s+\{([^\}]*)\}/;
@@ -151,6 +162,8 @@
             $percent.= ($rcharge*1000.0 / $rbatt)/10.
                 if(defined $rcurrent);
             
+	    my$foo="\n";
+	    syswrite B_FD,$foo,1;
         }
     }
     $percent;

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list