Enlightenment CVS committal

Author  : onefang
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore


Modified Files:
        ecore_main.c 


Log Message:
Just to be paranoid, and coz devilhorns caught it doing this, check for 
various naughty timeout values. 

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_main.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- ecore_main.c        19 Dec 2005 01:36:55 -0000      1.21
+++ ecore_main.c        1 Jan 2006 20:29:34 -0000       1.22
@@ -7,6 +7,7 @@
 
 #define FIX_HZ 1   
 
+#include <math.h>
 #include <sys/time.h>
 #include <sys/types.h>
 #include <unistd.h>
@@ -284,7 +285,13 @@
    Ecore_List2    *l;
 
    t = NULL;
-   if (timeout > 0.0)
+   if ((!finite(timeout)) || (timeout == 0.0))  /* finite() tests for NaN, too 
big, too small, and infinity.  */
+     {
+       tv.tv_sec = 0;
+       tv.tv_usec = 0;
+       t = &tv;
+     }
+   else if (timeout > 0.0)
      {
        int sec, usec;
 
@@ -300,12 +307,6 @@
        tv.tv_usec = usec;
        t = &tv;
      }
-   else if (timeout == 0.0)
-     {
-       tv.tv_sec = 0;
-       tv.tv_usec = 0;
-       t = &tv;
-     }
    max_fd = 0;
    FD_ZERO(&rfds);
    FD_ZERO(&wfds);




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to