[Pm-utils] [PATCH RFC] Merge 20video and 99video

Victor Lowther victor.lowther at gmail.com
Sun Feb 17 07:33:58 PST 2008


On Sat, Feb 16, 2008 at 10:35:33PM -0600, Victor Lowther wrote:
> It would help if I had actually tested the savestate/restorestate
> changes before sending the patch.  Just pretend those redirections are
> done correctly, okay? :)

Specifically: 

 pm/functions.in      |    4 ++--
 pm/sleep.d/94cpufreq |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pm/functions.in b/pm/functions.in
index bacfeaf..a7b8aeb 100644
--- a/pm/functions.in
+++ b/pm/functions.in
@@ -300,7 +300,7 @@ restartservice()
 savestate()
 {
 	if [ -z "$2" ]; then
-		exec > "${STORAGEDIR}/state:$1"
+		cat > "${STORAGEDIR}/state:$1"
 	else
 		echo "$2" > "${STORAGEDIR}/state:$1"
 	fi
@@ -313,5 +313,5 @@ state_exists()
 
 restorestate()
 {
-	state_exists "$1" && cat "${STORAGEDIR}/state:${1}"
+	state_exists "$1" && cat < "${STORAGEDIR}/state:${1}"
 }
diff --git a/pm/sleep.d/94cpufreq b/pm/sleep.d/94cpufreq
index 4a4412e..fe13c19 100755
--- a/pm/sleep.d/94cpufreq
+++ b/pm/sleep.d/94cpufreq
@@ -11,7 +11,7 @@ hibernate_cpufreq()
 		[ -f "$x" ] || continue
 		grep -q "$TEMPORARY_CPUFREQ_GOVERNOR" \
 			"${x%/*}/scaling_available_governors" || continue
-		cat "$x" |savestate "${x%%/*}_governor"
+		savestate "${x%%/*}_governor" < "$x"
 		echo "$TEMPORARY_CPUFREQ_GOVERNOR" > "$x"
 	done )
 }

-- 
Victor Lowther
Ubuntu Certified Professional


More information about the Pm-utils mailing list