diff mbox series

pcm_file: return errno in case of a failed write operation

Message ID 1561378896-28676-1-git-send-email-amiartus@de.adit-jv.com (mailing list archive)
State New, archived
Headers show
Series pcm_file: return errno in case of a failed write operation | expand

Commit Message

Adam Miartus June 24, 2019, 12:21 p.m. UTC
allows correct error code propagation for snd_pcm_file_write_bytes caller

Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
---
 src/pcm/pcm_file.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Takashi Iwai June 24, 2019, 12:24 p.m. UTC | #1
On Mon, 24 Jun 2019 14:21:36 +0200,
Adam Miartus wrote:
> 
> allows correct error code propagation for snd_pcm_file_write_bytes caller
> 
> Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>

Applied now.

But at the next time if you resubmit a revised patch, put "v2" or such
suffix in the subject.


thanks,

Takashi
diff mbox series

Patch

diff --git a/src/pcm/pcm_file.c b/src/pcm/pcm_file.c
index 11d0953..ab47da8 100644
--- a/src/pcm/pcm_file.c
+++ b/src/pcm/pcm_file.c
@@ -402,6 +402,7 @@  static int snd_pcm_file_write_bytes(snd_pcm_t *pcm, size_t bytes)
 			n = cont;
 		err = write(file->fd, file->wbuf + file->file_ptr_bytes, n);
 		if (err < 0) {
+			err = -errno;
 			SYSERR("%s write failed, file data may be corrupt", file->fname);
 			return err;
 		}