Skip to content

Commit 9ef8bbe

Browse files
committed
Simplify buffer size for write also.
1 parent 3802a30 commit 9ef8bbe

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

main/streams/plain_wrapper.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,8 @@ static ssize_t php_stdiop_write(php_stream *stream, const char *buf, size_t coun
353353
assert(data != NULL);
354354

355355
if (data->fd >= 0) {
356-
#ifdef PHP_WIN32
357-
ssize_t bytes_written = _write(data->fd, buf, (unsigned int)(count > INT_MAX ? INT_MAX : count));
358-
#else
359-
ssize_t bytes_written = write(data->fd, buf, count);
360-
#endif
356+
ssize_t bytes_written = write(data->fd, buf, PLAIN_WRAP_BUF_SIZE(count));
357+
361358
if (bytes_written < 0) {
362359
if (PHP_IS_TRANSIENT_ERROR(errno)) {
363360
return 0;

0 commit comments

Comments
 (0)