All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Miartus <amiartus@de.adit-jv.com>
To: patch@alsa-project.org
Cc: alsa-devel@alsa-project.org
Subject: [PATCH] pcm_file: return errno in case of a failed write operation
Date: Mon, 24 Jun 2019 14:21:36 +0200	[thread overview]
Message-ID: <1561378896-28676-1-git-send-email-amiartus@de.adit-jv.com> (raw)

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(+)

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;
 		}
-- 
2.7.4

             reply	other threads:[~2019-06-24 12:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 12:21 Adam Miartus [this message]
2019-06-24 12:24 ` [PATCH] pcm_file: return errno in case of a failed write operation Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1561378896-28676-1-git-send-email-amiartus@de.adit-jv.com \
    --to=amiartus@de.adit-jv.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=patch@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.