edbus connman - stop reporting the same error again and again one
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 8 Mar 2012 10:13:28 +0000 (10:13 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 8 Mar 2012 10:13:28 +0000 (10:13 +0000)
after the other. pointless.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/e_dbus@69045 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/connman0_7x/e_connman_private.h

index f13c936..d6f98f9 100644 (file)
@@ -109,9 +109,19 @@ _dbus_callback_check_and_init(DBusMessage *msg, DBusMessageIter *itr, DBusError
         if (err && (err->name[0] == 'C'))
           return EINA_FALSE;
         if (err)
-           ERR("an error was reported by server: "
-               "name=\"%s\", message=\"%s\"",
-               err->name, err->message);
+          {
+             /* dont keep reporting the same err again and again */
+             static char perr[256] = {0};
+             
+             if (!(!strncmp(perr, err->name, sizeof(perr) - 1)))
+               {
+                  ERR("an error was reported by server: "
+                      "name=\"%s\", message=\"%s\"",
+                      err->name, err->message);
+                  strncpy(perr, err->name, sizeof(perr) - 1);
+                  perr[sizeof(perr) - 1] = 0;
+               }
+          }
         else
            ERR("callback without message arguments!");