[Pm-utils] [PATCH 3/4] Add safety checks for *_fbcon()

Victor Lowther victor.lowther at gmail.com
Thu Feb 14 10:02:32 PST 2008


On Thu, Feb 14, 2008 at 05:02:06PM +0100, Michael Biebl wrote:
> 99video write to /sys/class/graphics/*/state unconditionally.
> 
> As I don't have a matching /sys/class/graphics/*/state, it tried to write to
> /sys/class/graphics/*/state.
> 
> Add a safety check before writing and skip if not a file.

Good catch, thanks.
 
> -- 
> Why is it that all of the instruments seeking intelligent life in the
> universe are pointed away from Earth?

> From 44cd3b7501d7a67602c5143e878de40efd153721 Mon Sep 17 00:00:00 2001
> From: Michael Biebl <mbiebl at gmail.com>
> Date: Thu, 14 Feb 2008 16:26:50 +0100
> Subject: [PATCH] Add safety checks for *_fbcon()
> 
> ---
>  pm/sleep.d/99video |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/pm/sleep.d/99video b/pm/sleep.d/99video
> index b54a7d1..bd01662 100755
> --- a/pm/sleep.d/99video
> +++ b/pm/sleep.d/99video
> @@ -35,6 +35,7 @@ save_fbcon()
>  {
>  	local con
>  	for con in /sys/class/graphics/*/state; do
> +		[ -f $con ] || continue
>  		echo 1 >"${con}"
>  	done
>  }
> @@ -43,6 +44,7 @@ resume_fbcon()
>  {
>  	local con
>  	for con in /sys/class/graphics/*/state; do
> +		[ -f $con ] || continue
>  		echo 0 >"${con}"
>  	done
>  }
> -- 
> 1.5.4.1
> 

> _______________________________________________
> Pm-utils mailing list
> Pm-utils at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pm-utils


-- 
Victor Lowther
Ubuntu Certified Professional


More information about the Pm-utils mailing list