summaryrefslogtreecommitdiff
path: root/android/hal-audio.c
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2014-03-01 14:11:55 +0100
committerSzymon Janc <szymon.janc@tieto.com>2014-03-01 17:22:23 +0100
commit21ad4b8f158baa9c795ca3d05dcdf9955c859953 (patch)
treed4894996c9d655e124022a038651fd1d599839fc /android/hal-audio.c
parenta374c5dc73e7b26832a67a0c5e89de89d8f3feec (diff)
downloadbluez-21ad4b8f158baa9c795ca3d05dcdf9955c859953.tar.gz
android/hal-audio: Fix errno handling in set_blocking
Diffstat (limited to 'android/hal-audio.c')
-rw-r--r--android/hal-audio.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/android/hal-audio.c b/android/hal-audio.c
index e1f3f0d59..f6f1e7da6 100644
--- a/android/hal-audio.c
+++ b/android/hal-audio.c
@@ -1266,13 +1266,15 @@ static int set_blocking(int fd)
flags = fcntl(fd, F_GETFL, 0);
if (flags < 0) {
- error("fcntl(F_GETFL): %s (%d)", strerror(errno), errno);
- return -errno;
+ int err = -errno;
+ error("fcntl(F_GETFL): %s (%d)", strerror(-err), -err);
+ return err;
}
if (fcntl(fd, F_SETFL, flags & ~O_NONBLOCK) < 0) {
- error("fcntl(F_SETFL): %s (%d)", strerror(errno), errno);
- return -errno;
+ int err = -errno;
+ error("fcntl(F_SETFL): %s (%d)", strerror(-err), -err);
+ return err;
}
return 0;