From 563016b7fe31a8918b3db2a2f2cbb67607ecd153 Mon Sep 17 00:00:00 2001 From: Roman Stratiienko Date: Tue, 26 Jul 2022 17:07:51 +0300 Subject: pcm: Propagate error message to the bad_pcm in case of failure Signed-off-by: Roman Stratiienko --- src/pcm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pcm.c b/src/pcm.c index d460593..d681563 100644 --- a/src/pcm.c +++ b/src/pcm.c @@ -1092,8 +1092,10 @@ struct pcm *pcm_open(unsigned int card, unsigned int device, } pcm->subdevice = info.subdevice; - if (pcm_set_config(pcm, config) != 0) + if (pcm_set_config(pcm, config) != 0) { + memcpy(bad_pcm.error, pcm->error, sizeof(pcm->error)); goto fail_close; + } rc = pcm_hw_mmap_status(pcm); if (rc < 0) { -- cgit v1.2.3