[PATCH 3/5] syndaemon: if we wanted XRECORD, but it failed, exit.
Henrik Rydberg
rydberg at euromail.se
Wed Mar 4 16:06:30 PST 2009
Peter Hutterer wrote:
> If Xrecord is missing but we requested it (say, didn't disable it explicitly),
> then exit. Don't use the alternative SHM area, it's bad for your health.
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
>
> ---
> On Mon, Mar 02, 2009 at 10:27:27AM +0100, Julien Cristau wrote:
> [...]
>>> @@ -535,8 +535,13 @@ main(int argc, char *argv[])
>>> }
>>> }
>>> #ifdef HAVE_XRECORD
>>> - if (use_xrecord && check_xrecord(display)) {
>>> - record_main_loop(display, idle_time);
>>> + if (use_xrecord)
>>> + {
>>> + if(check_xrecord(display))
>>> + record_main_loop(display, idle_time);
>>> + else
>>> + fprintf(stderr, "Use of XRecord requested, but failed to "
>>> + " initialize.\n");
>> Probably want to exit non-zero here?
>
> tools/syndaemon.c | 11 +++++++++--
> 1 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/tools/syndaemon.c b/tools/syndaemon.c
> index 515a132..91e1a61 100644
> --- a/tools/syndaemon.c
> +++ b/tools/syndaemon.c
> @@ -542,8 +542,15 @@ main(int argc, char *argv[])
> }
> }
> #ifdef HAVE_XRECORD
> - if (use_xrecord && check_xrecord(display)) {
> - record_main_loop(display, idle_time);
> + if (use_xrecord)
> + {
> + if(check_xrecord(display))
> + record_main_loop(display, idle_time);
> + else {
> + fprintf(stderr, "Use of XRecord requested, but failed to "
> + " initialize.\n");
> + exit(2);
> + }
> } else
> #endif /* HAVE_XRECORD */
> {
ACK
Henrik
More information about the xorg-devel
mailing list