[Goodies-commits] r6264 - in xfce4-mailwatch-plugin/trunk: . libmailwatch-core

Brian Tarricone kelnos at xfce.org
Thu Dec 4 09:36:58 CET 2008


Author: kelnos
Date: 2008-12-04 08:36:58 +0000 (Thu, 04 Dec 2008)
New Revision: 6264

Modified:
   xfce4-mailwatch-plugin/trunk/NEWS
   xfce4-mailwatch-plugin/trunk/libmailwatch-core/mailwatch-net-conn.c
Log:
fix 100% cpu usage issue while checking mail (bug 4494)

Modified: xfce4-mailwatch-plugin/trunk/NEWS
===================================================================
--- xfce4-mailwatch-plugin/trunk/NEWS	2008-12-03 22:36:44 UTC (rev 6263)
+++ xfce4-mailwatch-plugin/trunk/NEWS	2008-12-04 08:36:58 UTC (rev 6264)
@@ -8,6 +8,7 @@
     * Fix build when SSL is disabled.
     * Also support gtk-2.12-style tooltips, and make the tooltip auto-update
       in place if the status changes while the tooltip is active.
+    * Fix high CPU usage while checking mail (bug 4494).
 
 
 Version 1.1.0 (14 Sep 2008):

Modified: xfce4-mailwatch-plugin/trunk/libmailwatch-core/mailwatch-net-conn.c
===================================================================
--- xfce4-mailwatch-plugin/trunk/libmailwatch-core/mailwatch-net-conn.c	2008-12-03 22:36:44 UTC (rev 6263)
+++ xfce4-mailwatch-plugin/trunk/libmailwatch-core/mailwatch-net-conn.c	2008-12-04 08:36:58 UTC (rev 6264)
@@ -767,12 +767,18 @@
             return -1;
         } else if(!block)
             return 0;
-    } while(ret < 0 && EINTR == errno && !TIMER_EXPIRED(RECV_TIMEOUT)
-            && SHOULD_CONTINUE(net_conn));
+    } while((ret == 0 || (ret < 0 && EINTR == errno))
+            && !TIMER_EXPIRED(RECV_TIMEOUT) && SHOULD_CONTINUE(net_conn));
 
-    if(!SHOULD_CONTINUE(net_conn)) {
+    if(ret < 0 && EINTR != errno) {
         if(error) {
             g_set_error(error, XFCE_MAILWATCH_ERROR,
+                        XFCE_MAILWATCH_ERROR_FAILED, strerror(errno));
+        }
+        return -1;
+    } else if(!SHOULD_CONTINUE(net_conn)) {
+        if(error) {
+            g_set_error(error, XFCE_MAILWATCH_ERROR,
                         XFCE_MAILWATCH_ERROR_ABORTED, _("Operation aborted"));
         }
         return -1;




More information about the Goodies-commits mailing list