From aab47b293fa42cba6865a6991ca00c7eaafb9710 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 18 Dec 2013 15:17:21 -0800 Subject: [PATCH] libion: return -errno from ion_close Return -errno from ion_close instead of -1 on error. Change-Id: Idb828aa4b4d1a660b79d2dba8be32f306eac959d --- libion/ion.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libion/ion.c b/libion/ion.c index 985094925..80bdc2abc 100644 --- a/libion/ion.c +++ b/libion/ion.c @@ -40,7 +40,10 @@ int ion_open() int ion_close(int fd) { - return close(fd); + int ret = close(fd); + if (ret < 0) + return -errno; + return ret; } static int ion_ioctl(int fd, int req, void *arg)