All of lore.kernel.org
 help / color / mirror / Atom feed
From: han.lu@intel.com
To: tiwai@suse.de, liam.r.girdwood@linux.intel.com,
	bernard.gautier@intel.com, edward.c.popescu@intel.com,
	alsa-devel@alsa-project.org
Cc: "Lu, Han" <han.lu@intel.com>
Subject: [PATCH 09/10] alsabat: use variable for thread return value
Date: Wed,  2 Mar 2016 16:53:19 +0800	[thread overview]
Message-ID: <3788d26a68d34132a918b0eb19f7f0a7eb552641.1456907242.git.han.lu@intel.com> (raw)
In-Reply-To: <cover.1456907242.git.han.lu@intel.com>
In-Reply-To: <cover.1456907242.git.han.lu@intel.com>

From: "Lu, Han" <han.lu@intel.com>

Replace fixed "1" to variable for thread return value.

Signed-off-by: Lu, Han <han.lu@intel.com>

diff --git a/bat/alsa.c b/bat/alsa.c
index 0a5f899..189b0e9 100644
--- a/bat/alsa.c
+++ b/bat/alsa.c
@@ -309,13 +309,13 @@ void *playback_alsa(struct bat *bat)
 	if (err != 0) {
 		fprintf(bat->err, _("Cannot open PCM playback device: "));
 		fprintf(bat->err, _("%s(%d)\n"), snd_strerror(err), err);
-		retval_play = 1;
+		retval_play = err;
 		goto exit1;
 	}
 
 	err = set_snd_pcm_params(bat, &sndpcm);
 	if (err != 0) {
-		retval_play = 1;
+		retval_play = err;
 		goto exit2;
 	}
 
@@ -332,13 +332,13 @@ void *playback_alsa(struct bat *bat)
 			fprintf(bat->err, _("Cannot open file for playback: "));
 			fprintf(bat->err, _("%s %d\n"),
 					bat->playback.file, -errno);
-			retval_play = 1;
+			retval_play = -errno;
 			goto exit3;
 		}
 		/* Skip header */
 		err = read_wav_header(bat, bat->playback.file, bat->fp, true);
 		if (err != 0) {
-			retval_play = 1;
+			retval_play = err;
 			goto exit4;
 		}
 	}
@@ -348,7 +348,7 @@ void *playback_alsa(struct bat *bat)
 
 	err = write_to_pcm_loop(&sndpcm, bat);
 	if (err < 0) {
-		retval_play = 1;
+		retval_play = err;
 		goto exit4;
 	}
 
@@ -471,13 +471,13 @@ void *record_alsa(struct bat *bat)
 	if (err != 0) {
 		fprintf(bat->err, _("Cannot open PCM capture device: "));
 		fprintf(bat->err, _("%s(%d)\n"), snd_strerror(err), err);
-		retval_record = 1;
+		retval_record = err;
 		goto exit1;
 	}
 
 	err = set_snd_pcm_params(bat, &sndpcm);
 	if (err != 0) {
-		retval_record = 1;
+		retval_record = err;
 		goto exit2;
 	}
 
-- 
2.5.0

  parent reply	other threads:[~2016-03-02  8:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02  8:53 [PATCH 00/10] *** alsabat features and fixes *** han.lu
2016-03-02  8:53 ` [PATCH 01/10] alsabat: add default device name for playback and capture han.lu
2016-03-04 20:57   ` Takashi Iwai
2016-03-07  1:24     ` Lu, Han
2016-03-08 10:15       ` Takashi Iwai
2016-03-02  8:53 ` [PATCH 02/10] alsabat: add standalone mode han.lu
2016-03-08 10:18   ` Takashi Iwai
2016-03-15  3:45     ` Lu, Han
2016-03-02  8:53 ` [PATCH 03/10] alsabat: add tinyalsa support han.lu
2016-03-11 14:13   ` Takashi Iwai
2016-03-15  3:50     ` Lu, Han
2016-03-02  8:53 ` [PATCH 04/10] alsabat: clean the thread loopback of alsa capture han.lu
2016-03-02  8:53 ` [PATCH 05/10] alsabat: refactor wav file process han.lu
2016-03-02  8:53 ` [PATCH 06/10] alsabat: use common data generator function han.lu
2016-03-02  8:53 ` [PATCH 07/10] alsabat: add interrupt handler for shutdown han.lu
2016-03-02  8:53 ` [PATCH 08/10] alsabat: fix an incorrect print han.lu
2016-03-02  8:53 ` han.lu [this message]
2016-03-11 13:34   ` [PATCH 09/10] alsabat: use variable for thread return value Takashi Iwai
2016-03-14  9:15     ` Lu, Han
2016-03-14  9:21       ` Takashi Iwai
2016-03-14  9:36         ` Lu, Han
2016-03-14  9:43           ` Takashi Iwai
2016-03-14  9:53             ` Lu, Han
2016-03-02  8:53 ` [PATCH 10/10] alsabat: add bash test script han.lu
2016-03-04 20:58   ` 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=3788d26a68d34132a918b0eb19f7f0a7eb552641.1456907242.git.han.lu@intel.com \
    --to=han.lu@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bernard.gautier@intel.com \
    --cc=edward.c.popescu@intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=tiwai@suse.de \
    /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.