[PATCH synaptics] syndaemon: if record was requested but failed, fall back.

Peter Hutterer peter.hutterer at who-t.net
Wed Feb 16 16:05:59 PST 2011


Don't exit because record isn't available, simply fall back to polling mode.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 tools/syndaemon.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/tools/syndaemon.c b/tools/syndaemon.c
index 9779935..ac9c1a6 100644
--- a/tools/syndaemon.c
+++ b/tools/syndaemon.c
@@ -602,22 +602,26 @@ main(int argc, char *argv[])
     store_current_touchpad_state();
 
 #ifdef HAVE_X11_EXTENSIONS_RECORD_H
-    if (use_xrecord)
+    if (use_xrecord && check_xrecord(display))
     {
-	if(check_xrecord(display))
-	    record_main_loop(display, idle_time);
-	else {
-	    fprintf(stderr, "Use of XRecord requested, but failed to "
-		    " initialize.\n");
-            exit(2);
-        }
+	record_main_loop(display, idle_time);
     } else
 #endif /* HAVE_X11_EXTENSIONS_RECORD_H */
-      {
+    {
+	if (use_xrecord)
+	    fprintf(stderr, "XRecord %s, falling back to "
+		    " polling mode.\n",
+#ifdef HAVE_X11_EXTENSIONS_RECORD_H
+		    "not supported by the server"
+#else
+		    "not built in"
+#endif
+		    );
+
 	setup_keyboard_mask(display, ignore_modifier_keys);
 
 	/* Run the main loop */
 	main_loop(display, idle_time, poll_delay);
-      }
+    }
     return 0;
 }
-- 
1.7.3.5



More information about the xorg-devel mailing list