mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-12-22 23:26:30 +01:00
fix ssize_t bytes_written; if (receive_file != -1) { bytes_written = write(receive_file, buf, length); if (bytes_written != length) { // handle the error, e.g., print an error message or break the loop error("write() failed:
fix ssize_t bytes_written; if (receive_file != -1) { bytes_written = write(receive_file, buf, length); if (bytes_written != length) { // handle the error, e.g., print an error message or brea
This commit is contained in:
parent
041c190799
commit
32b5f63376
1 changed files with 11 additions and 2 deletions
|
@ -728,9 +728,18 @@ int main(int argc, char *argv[])
|
|||
if (length == 0)
|
||||
continue;
|
||||
read += length;
|
||||
|
||||
ssize_t bytes_written;
|
||||
|
||||
if (receive_file != -1) {
|
||||
bytes_written = write(receive_file, buf, length);
|
||||
if (bytes_written != length) {
|
||||
// handle the error, e.g., print an error message or break the loop
|
||||
error("write() failed: %s", strerror(errno));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (receive_file != -1)
|
||||
write(receive_file, buf, length);
|
||||
if (dump) {
|
||||
for (i = 0; i < length; ++i)
|
||||
print_byte(buf[i], &ts);
|
||||
|
|
Loading…
Reference in a new issue