Re: cvs: php-src /ext/sockets sockets.c /ext/standard streamsfuncs.c

From: Date: Thu, 24 Jul 2003 02:09:10 +0000
Subject: Re: cvs: php-src /ext/sockets sockets.c /ext/standard streamsfuncs.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-22757@lists.php.net to get a copy of this message
MFH (to PHP_4_3 branch). And try to use the bug numbers in the commit messages. And add news entry in the NEWS file (in PHP_4_3 branch). --Jani On Tue, 22 Jul 2003, Jason Greene wrote: >jason Tue Jul 22 03:20:56 2003 EDT > > Modified files: > /php-src/ext/sockets sockets.c > /php-src/ext/standard streamsfuncs.c > Log: > Fix EINVAL errors for OS's (Solaris + BSD) that do not appreciate microseconds >= 1 > second > Patch submitted from meebery@php.net > > >Index: php-src/ext/sockets/sockets.c >diff -u php-src/ext/sockets/sockets.c:1.146 php-src/ext/sockets/sockets.c:1.147 >--- php-src/ext/sockets/sockets.c:1.146 Tue Jul 8 01:00:13 2003 >+++ php-src/ext/sockets/sockets.c Tue Jul 22 03:20:55 2003 >@@ -19,7 +19,7 @@ > +----------------------------------------------------------------------+ > */ > >-/* $Id: sockets.c,v 1.146 2003/07/08 05:00:13 pollita Exp $ */ >+/* $Id: sockets.c,v 1.147 2003/07/22 07:20:55 jason Exp $ */ > > #ifdef HAVE_CONFIG_H > #include "config.h" >@@ -641,8 +641,16 @@ > convert_to_long(&tmp); > sec = &tmp; > } >- tv.tv_sec = Z_LVAL_P(sec); >- tv.tv_usec = usec; >+ >+ /* Solaris + BSD do not like microsecond values which are >= 1 sec */ >+ if (usec > 999999) { >+ tv.tv_sec = Z_LVAL_P(sec) + (usec / 1000000); >+ tv.tv_usec = usec % 1000000; >+ } else { >+ tv.tv_sec = Z_LVAL_P(sec); >+ tv.tv_usec = usec; >+ } >+ > tv_p = &tv; > > if (sec == &tmp) { >Index: php-src/ext/standard/streamsfuncs.c >diff -u php-src/ext/standard/streamsfuncs.c:1.24 php-src/ext/standard/streamsfuncs.c:1.25 >--- php-src/ext/standard/streamsfuncs.c:1.24 Sat Jun 28 07:24:46 2003 >+++ php-src/ext/standard/streamsfuncs.c Tue Jul 22 03:20:55 2003 >@@ -17,7 +17,7 @@ > +----------------------------------------------------------------------+ > */ > >-/* $Id: streamsfuncs.c,v 1.24 2003/06/28 11:24:46 wez Exp $ */ >+/* $Id: streamsfuncs.c,v 1.25 2003/07/22 07:20:55 jason Exp $ */ > > #include "php.h" > #include "php_globals.h" >@@ -563,8 +563,16 @@ > /* If seconds is not set to null, build the timeval, else we wait indefinitely */ > if (sec != NULL) { > convert_to_long_ex(&sec); >- tv.tv_sec = Z_LVAL_P(sec); >- tv.tv_usec = usec; >+ >+ /* Solaris + BSD do not like microsecond values which are >= 1 sec */ >+ if (usec > 999999) { >+ tv.tv_sec = Z_LVAL_P(sec) + (usec / 1000000); >+ tv.tv_usec = usec % 1000000; >+ } else { >+ tv.tv_sec = Z_LVAL_P(sec); >+ tv.tv_usec = usec; >+ } >+ > tv_p = &tv; > } > > > > > -- https://www.paypal.com/xclick/business=sniper@php.net&no_note=1&tax=0&currency_code=EUR

« previous php.cvs (#22757) next »