[Glibc-bsd-commits] r4183 - in trunk/freebsd-utils/debian: . patches

Robert Millan rmh at alioth.debian.org
Mon Apr 9 21:38:24 UTC 2012


Author: rmh
Date: 2012-04-09 21:38:23 +0000 (Mon, 09 Apr 2012)
New Revision: 4183

Added:
   trunk/freebsd-utils/debian/patches/powerd_no_cpufreq.diff
Modified:
   trunk/freebsd-utils/debian/changelog
   trunk/freebsd-utils/debian/patches/series
   trunk/freebsd-utils/debian/powerd.init
Log:
Make powerd fail gacefully when cpufreq(4) support isn't available.

Modified: trunk/freebsd-utils/debian/changelog
===================================================================
--- trunk/freebsd-utils/debian/changelog	2012-04-09 21:31:10 UTC (rev 4182)
+++ trunk/freebsd-utils/debian/changelog	2012-04-09 21:38:23 UTC (rev 4183)
@@ -2,8 +2,9 @@
 
   * Restore default CPU frequency after stopping powerd.
   * Replace mount wrap script with source patch (mount_cli_compat.diff).
+  * Make powerd fail gacefully when cpufreq(4) support isn't available.
 
- -- Robert Millan <rmh at debian.org>  Mon, 09 Apr 2012 23:30:57 +0200
+ -- Robert Millan <rmh at debian.org>  Mon, 09 Apr 2012 23:37:48 +0200
 
 freebsd-utils (9.0+ds1-2) unstable; urgency=low
 

Added: trunk/freebsd-utils/debian/patches/powerd_no_cpufreq.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/powerd_no_cpufreq.diff	                        (rev 0)
+++ trunk/freebsd-utils/debian/patches/powerd_no_cpufreq.diff	2012-04-09 21:38:23 UTC (rev 4183)
@@ -0,0 +1,22 @@
+
+From SVN rev 234070.
+
+--- a/usr.sbin/powerd/powerd.c
++++ b/usr.sbin/powerd/powerd.c
+@@ -44,6 +44,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sysexits.h>
+ #include <unistd.h>
+ 
+ #ifdef __i386__
+@@ -536,7 +537,7 @@
+ 		err(1, "lookup kern.cp_times");
+ 	len = 4;
+ 	if (sysctlnametomib("dev.cpu.0.freq", freq_mib, &len))
+-		err(1, "lookup freq");
++		err(EX_UNAVAILABLE, "no cpufreq(4) support -- aborting");
+ 	len = 4;
+ 	if (sysctlnametomib("dev.cpu.0.freq_levels", levels_mib, &len))
+ 		err(1, "lookup freq_levels");

Modified: trunk/freebsd-utils/debian/patches/series
===================================================================
--- trunk/freebsd-utils/debian/patches/series	2012-04-09 21:31:10 UTC (rev 4182)
+++ trunk/freebsd-utils/debian/patches/series	2012-04-09 21:38:23 UTC (rev 4183)
@@ -1,5 +1,6 @@
 # Patches that come from upstream
 ifconfig_nojail.diff
+powerd_no_cpufreq.diff
 
 # Patches that are in good shape for merging upstream
 pf_regex_c.diff

Modified: trunk/freebsd-utils/debian/powerd.init
===================================================================
--- trunk/freebsd-utils/debian/powerd.init	2012-04-09 21:31:10 UTC (rev 4182)
+++ trunk/freebsd-utils/debian/powerd.init	2012-04-09 21:38:23 UTC (rev 4183)
@@ -46,11 +46,12 @@
 	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
 		|| return 1
 	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
-		$DAEMON_ARGS \
-		|| return 2
-	# Add code here, if necessary, that waits for the process to be ready
-	# to handle requests from services started subsequently which depend
-	# on this one.  As a last resort, sleep for some time.
+		$DAEMON_ARGS
+	case "$?" in
+		0) ;;
+		69) ;; # EX_UNAVAILABLE
+		*) return 2 ;;
+	esac
 }
 
 #




More information about the Glibc-bsd-commits mailing list