Skip to contentSkip to conversation

pcm_file: return errno in case of a failed write operation

PATCH In review Adam Miartus 2 participants 2 messages Jun 24, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pcm_file: return errno in case of a failed write operation

allows correct error code propagation for snd_pcm_file_write_bytes caller

---
 src/pcm/pcm_file.c | 1 +
 1 file changed, 1 insertion(+)
src/pcm/pcm_file.c +1 -0
index 11d0953..ab47da8 100644
@@ -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;
 		}
Signature · 1 line
2.7.4
#1 lore raw
Quoted 4 lines · Adam Miartus

allows correct error code propagation for snd_pcm_file_write_bytes caller

Applied now.

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

thanks,

Takashi