[oe-commits] org.oe.dev ipaq-sleep 0.9: More fixes.

pfalcon commit openembedded-commits at lists.openembedded.org
Wed Dec 26 05:07:24 UTC 2007


ipaq-sleep 0.9: More fixes.
* Don't try to interpret APM status when it's not available.
* Don't assume X mode is always active.

Author: pfalcon at openembedded.org
Branch: org.openembedded.dev
Revision: c96094d950128680cbddb0ad4739db63ac8ed145
ViewMTN: http://monotone.openembedded.org/revision/info/c96094d950128680cbddb0ad4739db63ac8ed145
Files:
1
packages/ipaq-sleep/files/unbreak.patch
packages/ipaq-sleep/ipaq-sleep_0.9.bb
Diffs:

#
# mt diff -rcd5d3c7e2ef73f5f2659e33fcb91e8e40b2560cf -rc96094d950128680cbddb0ad4739db63ac8ed145
#
# 
# 
# patch "packages/ipaq-sleep/files/unbreak.patch"
#  from [8a6b3f0367f276bd9316801e12954588a030e965]
#    to [82c746189acc9bc10b34b75a7a4320d112e89f4c]
# 
# patch "packages/ipaq-sleep/ipaq-sleep_0.9.bb"
#  from [ba764a9cbe6a4f98d40dbc9ec9defdc04f74173e]
#    to [1bcde06105685373859a9e420d02cc480b3061a8]
# 
============================================================
--- packages/ipaq-sleep/files/unbreak.patch	8a6b3f0367f276bd9316801e12954588a030e965
+++ packages/ipaq-sleep/files/unbreak.patch	82c746189acc9bc10b34b75a7a4320d112e89f4c
@@ -1,15 +1,5 @@
-If there's something to unbreak... Do following:
-1. Support logging. Software without logging is now software,
-but a random wreck.
-2. Don't do off-by-one errors.
-3. Don't bug on system every 2 seconds. Instead, do a select
-on X connection to catch touchscreen events ASAP. This doesn't
-work for keys though, there's larger latency. As for other checks,
-do them once in 5s.
-4. The whole thing must die. Soon.
-
 --- a/ipaq-sleep.c.org	2006-01-20 19:43:14.000000000 +0200
-+++ a/ipaq-sleep.c	2007-12-26 02:50:06.000000000 +0200
++++ a/ipaq-sleep.c	2007-12-26 03:59:28.000000000 +0200
 @@ -27,14 +27,14 @@
  #include <X11/Xlib.h>
  #include <X11/extensions/scrnsaver.h>
@@ -31,7 +21,7 @@ 4. The whole thing must die. Soon.
  Window root;		    /* The root window (which holds MIT_SCREEN_SAVER
  			       info). */
  XScreenSaverInfo *info;	    /* The MIT_SCREEN_SAVER info object. */
-+int xfd;
++int xfd = -1;
  
  int init() { 
  	int first_event, first_error;
@@ -53,16 +43,20 @@ 4. The whole thing must die. Soon.
  	  else
  	    r = -1;
  	}
-@@ -488,7 +491,7 @@
+@@ -487,8 +490,11 @@
+ 		return(1);
  	}
  
++	if (info.ac_line_status == AC_LINE_STATUS_UNKNOWN || info.battery_status == BATTERY_STATUS_UNKNOWN)
++		return(1);
++
  #ifdef DEBUG
 -	if (debug) fprintf(dgfp,"You are NOT on external power. Its all good.....\n");
 +	if (debug) fprintf(dgfp,"You are NOT on external power. Line status: %d, battery status: %d.\n", info.ac_line_status, info.battery_status);
  #endif
  	runtime = info.battery_time;
  	if (apm && runtime >= 0 && runtime < battery_level)
-@@ -587,12 +590,17 @@
+@@ -587,12 +593,17 @@
  	
  }		
  
@@ -80,7 +74,7 @@ 4. The whole thing must die. Soon.
    	
  	Time idleTime; /* milliseconds */
          FILE *f;
-@@ -656,6 +664,7 @@
+@@ -656,6 +667,7 @@
  			if (dimming  && !dimmed && !apm_active) {
  				if ((newIdle-oldIdle)>=dim_idle) {
  					current_bl = read_backlight ();
@@ -88,7 +82,7 @@ 4. The whole thing must die. Soon.
  					set_backlight (dim_level);
  					dimmed=1;
  				}
-@@ -664,6 +673,11 @@
+@@ -664,6 +676,11 @@
  			lastIdle=newIdle;
  	
  		}
@@ -100,7 +94,7 @@ 4. The whole thing must die. Soon.
  
  		apm_active=check_apm();
  		if (apm_active) {
-@@ -724,16 +738,26 @@
+@@ -724,16 +741,27 @@
  			
  		}
  
@@ -113,7 +107,8 @@ 4. The whole thing must die. Soon.
 +		struct timeval tv;
 +		fd_set readset;
 +		FD_ZERO(&readset);
-+		FD_SET(xfd, &readset);
++		if (xfd != -1)
++		    FD_SET(xfd, &readset);
 +		tv.tv_sec = 1;
 +		tv.tv_usec = 0;
 +		if (debug) fprintf(dgfp, "select=%d, tv_sec=%d, tv_usec=%d\n", select(xfd+1, &readset, NULL, NULL, &tv), tv.tv_sec, tv.tv_usec);
@@ -130,7 +125,7 @@ 4. The whole thing must die. Soon.
  #endif
  			total_unused=0;
  			
-@@ -764,7 +788,7 @@
+@@ -764,7 +792,7 @@
  
  #ifdef DEBUG
  	if (debug) {
============================================================
--- packages/ipaq-sleep/ipaq-sleep_0.9.bb	ba764a9cbe6a4f98d40dbc9ec9defdc04f74173e
+++ packages/ipaq-sleep/ipaq-sleep_0.9.bb	1bcde06105685373859a9e420d02cc480b3061a8
@@ -10,7 +10,7 @@ SRC_URI_append = " file://unbreak.patch;
 SRC_URI_append = " file://install-fix.patch;patch=1"
 SRC_URI_append = " file://unbreak.patch;patch=1"
 
-PR = "r2"
+PR = "r3"
 
 DESCRIPTION = "Automatic sleep/suspend control daemon"
 






More information about the Openembedded-commits mailing list