]> granicus.if.org Git - php/commitdiff
Fix ftruncate() with negative size on FreeBSD
authorHannes Magnusson <bjori@php.net>
Thu, 16 Nov 2006 16:06:51 +0000 (16:06 +0000)
committerHannes Magnusson <bjori@php.net>
Thu, 16 Nov 2006 16:06:51 +0000 (16:06 +0000)
main/streams/plain_wrapper.c

index 9506428513d1ebb56684366590aaccb08779fd6a..f268eaf07c5da66a1d42a7cc3dbb9e3476436652 100644 (file)
@@ -761,7 +761,7 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void
                                        return fd == -1 ? PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK;
 
                                case PHP_STREAM_TRUNCATE_SET_SIZE:
-                                       return ftruncate(fd, *(size_t*)ptrparam) == 0 ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR;
+                                       return ftruncate(fd, *(ptrdiff_t*)ptrparam) == 0 ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR;
                        }
                        
                default: