[PATCH 6/6] Use signal safe functions when logging touch issues in SIGIO

Chase Douglas chase.douglas at canonical.com
Fri Apr 6 11:25:59 PDT 2012


Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
---
 dix/getevents.c |   15 +++++++++++++--
 dix/touch.c     |   11 +++++++++--
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index 3093786..4fa6d5e 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1822,8 +1822,19 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
         touchpoint.ti =
             TouchFindByDDXID(dev, ddx_touchid, (type == XI_TouchBegin));
         if (!touchpoint.ti) {
-            ErrorF("[dix] %s: unable to %s touch point %x\n", dev->name,
-                   type == XI_TouchBegin ? "begin" : "find", ddx_touchid);
+            char number[11] = "          ";
+
+            FormatUInt32(ddx_touchid, number);
+
+            LogMessageVerbSigSafe(X_NONE, -1, "[dix] ");
+            LogMessageVerbSigSafe(X_NONE, -1, dev->name);
+            LogMessageVerbSigSafe(X_NONE, -1, ": unable to ");
+            LogMessageVerbSigSafe(X_NONE, -1,
+                                  (type == XI_TouchBegin ? "begin " : "find "));
+            LogMessageVerbSigSafe(X_NONE, -1, "touch point ");
+            LogMessageVerbSigSafe(X_NONE, -1, number);
+            LogMessageVerbSigSafe(X_NONE, -1, "\n");
+
             return 0;
         }
         client_id = touchpoint.ti->client_id;
diff --git a/dix/touch.c b/dix/touch.c
index 0829b65..fefffb9 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -161,6 +161,7 @@ TouchBeginDDXTouch(DeviceIntPtr dev, uint32_t ddx_id)
     TouchClassPtr t = dev->touch;
     DDXTouchPointInfoPtr ti = NULL;
     Bool emulate_pointer = (t->mode == XIDirectTouch);
+    char number[11];
 
     if (!t)
         return NULL;
@@ -198,8 +199,14 @@ TouchBeginDDXTouch(DeviceIntPtr dev, uint32_t ddx_id)
     /* If we get here, then we've run out of touches and we need to drop the
      * event (we're inside the SIGIO handler here) schedule a WorkProc to
      * grow the queue for us for next time. */
-    ErrorF("%s: not enough space for touch events (max %d touchpoints). "
-           "Dropping this event.\n", dev->name, dev->last.num_touches);
+    FormatUInt32(dev->last.num_touches, number);
+
+    LogMessageVerbSigSafe(X_NONE, -1, dev->name);
+    LogMessageVerbSigSafe(X_NONE, -1,
+                          ": not enough space for touch events (max ");
+    LogMessageVerbSigSafe(X_NONE, -1, number);
+    LogMessageVerbSigSafe(X_NONE, -1, " touchpoints). Dropping this event.\n");
+
     if (!BitIsOn(resize_waiting, dev->id)) {
         SetBit(resize_waiting, dev->id);
         QueueWorkProc(TouchResizeQueue, serverClient, NULL);
-- 
1.7.9.1



More information about the xorg-devel mailing list