output/recorder: fix write() error check

We can only check for negative values if the variable is signed.
This commit is contained in:
Max Kellermann
2012-10-02 00:00:56 +02:00
parent fbcbcdc001
commit d34e55c370
2 changed files with 4 additions and 3 deletions

View File

@@ -140,9 +140,9 @@ recorder_output_encoder_to_file(struct recorder_output *recorder,
size_t position = 0;
while (true) {
size_t nbytes = write(recorder->fd,
recorder->buffer + position,
size - position);
ssize_t nbytes = write(recorder->fd,
recorder->buffer + position,
size - position);
if (nbytes > 0) {
position += (size_t)nbytes;
if (position >= size)