[PATCH:xset 1/3] Give better error for "xset dpms force" without argument

Jeremy Huddleston jeremyhu at apple.com
Fri Jul 15 23:50:49 PDT 2011


For the series:

Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>

On Jul 15, 2011, at 6:34 PM, Alan Coopersmith wrote:

> Changes from "xset:  unknown option force" to
> "xset:  missing argument to dpms force"
> 
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
> xset.c |    5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/xset.c b/xset.c
> index f41dbb5..7703618 100644
> --- a/xset.c
> +++ b/xset.c
> @@ -555,8 +555,9 @@ main(int argc, char *argv[])
> 		    DPMSEnable(dpy);
> 		    DPMSSetTimeouts(dpy, standby_timeout, suspend_timeout,
> 			off_timeout);
> -		} else if (i + 1 < argc && strcmp(arg, "force") == 0) {
> -		    i++;
> +		} else if (strcmp(arg, "force") == 0) {
> +		    if (++i >= argc)
> +			usage("missing argument to dpms force", NULL);
> 		    arg = argv[i];
> 		    /*
> 		     * The calls to usleep below are necessary to
> -- 
> 1.7.3.2
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
> 



More information about the xorg-devel mailing list