summaryrefslogtreecommitdiff
path: root/src/output/plugins/SndioOutputPlugin.cxx
diff options
context:
space:
mode:
authorDimitris Papastamos <sin@2f30.org>2016-06-22 14:52:40 +0100
committerMax Kellermann <max@duempel.org>2016-06-22 16:10:46 +0200
commit26c09244614950b173b7ce9a9f9d5844510d9a43 (patch)
treec364107037e598cf65155e457c4c37ff1119260c /src/output/plugins/SndioOutputPlugin.cxx
parentd4f801a8e910e1bad1b770e7a5a30ce1c53a8f16 (diff)
sndio: Eliminate remaining goto usage to conform to MPD style
Diffstat (limited to 'src/output/plugins/SndioOutputPlugin.cxx')
-rw-r--r--src/output/plugins/SndioOutputPlugin.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/output/plugins/SndioOutputPlugin.cxx b/src/output/plugins/SndioOutputPlugin.cxx
index e0897caca..b4f807ce9 100644
--- a/src/output/plugins/SndioOutputPlugin.cxx
+++ b/src/output/plugins/SndioOutputPlugin.cxx
@@ -143,7 +143,8 @@ SndioOutput::Open(AudioFormat &audio_format, gcc_unused Error &error)
!sio_getpar(sio_hdl, &par)) {
error.Format(sndio_output_domain, -1,
"Failed to set/get audio params");
- goto err;
+ sio_close(sio_hdl);
+ return false;
}
if (par.bits != bits ||
@@ -154,19 +155,18 @@ SndioOutput::Open(AudioFormat &audio_format, gcc_unused Error &error)
par.le != SIO_LE_NATIVE) {
error.Format(sndio_output_domain, -1,
"Requested audio params cannot be satisfied");
- goto err;
+ sio_close(sio_hdl);
+ return false;
}
if (!sio_start(sio_hdl)) {
error.Format(sndio_output_domain, -1,
"Failed to start audio device");
- goto err;
+ sio_close(sio_hdl);
+ return false;
}
return true;
-err:
- sio_close(sio_hdl);
- return false;
}
void