summaryrefslogtreecommitdiffstats
path: root/src/modules/bluetooth/module-bluetooth-device.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-06-17 04:51:57 +0200
committerLennart Poettering <lennart@poettering.net>2009-06-17 04:51:57 +0200
commitbd8e043a52834f3d3286ece03de46f498c9e241c (patch)
treecb4443997b262fbad13390a85cc6676dfd930a44 /src/modules/bluetooth/module-bluetooth-device.c
parent334325efd7d8ba32ca3c4ba8f90dccae7abe914c (diff)
bluetooth: return sensible error code in set_profile()
Diffstat (limited to 'src/modules/bluetooth/module-bluetooth-device.c')
-rw-r--r--src/modules/bluetooth/module-bluetooth-device.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 9fec4edf..6bcd0b80 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -1920,7 +1920,7 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
if (!(device = pa_bluetooth_discovery_get_by_path(u->discovery, u->path))) {
pa_log_error("Failed to get device object.");
- return -1;
+ return -PA_ERR_IO;
}
/* The state signal is sent by bluez, so it is racy to check
@@ -1930,11 +1930,11 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
module will be unloaded. */
if (device->headset_state < PA_BT_AUDIO_STATE_CONNECTED && *d == PROFILE_HSP) {
pa_log_warn("HSP is not connected, refused to switch profile");
- return -1;
+ return -PA_ERR_IO;
}
else if (device->audio_sink_state < PA_BT_AUDIO_STATE_CONNECTED && *d == PROFILE_A2DP) {
pa_log_warn("A2DP is not connected, refused to switch profile");
- return -1;
+ return -PA_ERR_IO;
}
if (u->sink) {