Browse Source

Exit correctly on write errors

This line (from a 9-year-old commit!) causes `alsa_in` to infinite-loop when a device is unplugged, writing `err = -11` to the standard output. It's possible `-11` could be special-cased if it represents a more specific kind of error, but the program should exit gracefully with an error code in this case.
pull/11/head
Jeanine Adkisson GitHub 4 years ago
parent
commit
e97c773197
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      alsa_in.c

+ 2
- 2
alsa_in.c View File

@@ -439,8 +439,8 @@ again:
if( err < 0 ) {
printf( "err = %d\n", err );
if (xrun_recovery(alsa_handle, err) < 0) {
//printf("Write error: %s\n", snd_strerror(err));
//exit(EXIT_FAILURE);
printf("Write error: %s\n", snd_strerror(err));
exit(EXIT_FAILURE);
}
goto again;
}


Loading…
Cancel
Save