mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-07 13:30:07 -05:00
pcm_file: return errno in case of a failed write operation
allows correct error code propagation for snd_pcm_file_write_bytes caller Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
7b1af71173
commit
053b430980
1 changed files with 1 additions and 0 deletions
|
|
@ -402,6 +402,7 @@ static int snd_pcm_file_write_bytes(snd_pcm_t *pcm, size_t bytes)
|
||||||
n = cont;
|
n = cont;
|
||||||
err = write(file->fd, file->wbuf + file->file_ptr_bytes, n);
|
err = write(file->fd, file->wbuf + file->file_ptr_bytes, n);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
|
err = -errno;
|
||||||
SYSERR("%s write failed, file data may be corrupt", file->fname);
|
SYSERR("%s write failed, file data may be corrupt", file->fname);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue