Skip to contentSkip to conversation

pcm_file: remove double line

PATCH Applied Adam Miartus 2 participants 4 messages Jun 24, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 pcm_file: remove double line

snd_pcm_file_add_frames called two times by mistake, introduced in 2a800c0c4f259043c9217a4aa6a57afaf9f77477

---
 src/pcm/pcm_file.c | 1 -
 1 file changed, 1 deletion(-)
src/pcm/pcm_file.c +0 -1
index ca8e0c8..11d0953 100644
@@ -613,7 +613,6 @@ static snd_pcm_sframes_t snd_pcm_file_readi(snd_pcm_t *pcm, void *buffer, snd_pc
 	snd_pcm_areas_from_buf(pcm, areas, buffer);
 	snd_pcm_file_areas_read_infile(pcm, areas, 0, frames);
 	__snd_pcm_lock(pcm);
-	snd_pcm_file_add_frames(pcm, areas, 0, frames);
 	if (snd_pcm_file_add_frames(pcm, areas, 0, frames) < 0) {
 		__snd_pcm_unlock(pcm);
 		return -EPIPE;
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 pcm_file: return errno

---
 src/pcm/pcm_file.c | 1 +
 1 file changed, 1 insertion(+)
src/pcm/pcm_file.c +1 -0
index 11d0953..3712fd8 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
#2 lore raw

Re: [PATCH 2/2] pcm_file: return errno

Quoted 11 lines · Adam Miartus
---
 src/pcm/pcm_file.c | 1 +
 1 file changed, 1 insertion(+)
src/pcm/pcm_file.c +0 -0
index 11d0953..3712fd8 100644

src/pcm/pcm_file.c static int snd_pcm_file_write_bytes(snd_pcm_t *pcm, size_t bytes) · line 405

Quoted 4 lines
src/pcm/pcm_file.c +1 -0
@@ -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;

It must be -errno.

Takashi