Skip to content

Commit

Permalink
Fix warning (#3398)
Browse files Browse the repository at this point in the history
  • Loading branch information
twose authored Jun 16, 2020
1 parent 262d96d commit 79bb02d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion swoole_runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static ssize_t socket_write(php_stream *stream, const char *buf, size_t count)

didwrite = sock->send_all(buf, count);

if (didwrite != count)
if (didwrite < 0 || (size_t) didwrite != count)
{
/* we do not expect the outer layer to continue to call the send syscall in a loop
* and didwrite is meaningless if it failed */
Expand Down

0 comments on commit 79bb02d

Please sign in to comment.