shane           Sun Oct 27 18:01:46 2002 EDT

  Modified files:              
    /php4/main  streams.c 
  Log:
  fix Bug #20126
  write returns an int, with < 0 being a failure.
  
  
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.117 php4/main/streams.c:1.118
--- php4/main/streams.c:1.117   Thu Oct 24 09:14:47 2002
+++ php4/main/streams.c Sun Oct 27 18:01:45 2002
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: streams.c,v 1.117 2002/10/24 13:14:47 sas Exp $ */
+/* $Id: streams.c,v 1.118 2002/10/27 23:01:45 shane Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -1260,9 +1260,9 @@
        assert(data != NULL);
 
        if (data->fd >= 0) {
-               
-               return write(data->fd, buf, count);
-
+               int bytes_written = write(data->fd, buf, count);
+               if (bytes_written < 0) return 0;
+               return (size_t) bytes_written;
        } else {
 
 #if HAVE_FLUSHIO



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to