summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorINSUN PYO <insun.pyo@samsung.com>2020-03-25 22:29:34 (GMT)
committerHyotaek Shim <hyotaek.shim@samsung.com>2020-03-26 01:24:41 (GMT)
commit8b2718ffda53041b5a5c4692178f052643cc2e95 (patch)
treee276a0e0320b4decd80a750409ac071b2a031977
parent24cd219f7051a45d7c198fd34b12d441efc8e32c (diff)
downloadlibdevice-node-8b2718ffda53041b5a5c4692178f052643cc2e95.zip
libdevice-node-8b2718ffda53041b5a5c4692178f052643cc2e95.tar.gz
libdevice-node-8b2718ffda53041b5a5c4692178f052643cc2e95.tar.bz2
Fixed incorrect use of errno in usb cfs clientrefs/changes/13/228813/1
Change-Id: Ib091544138444c4108c7b09eb3e70e830661648e (cherry picked from commit d8d490bd8049ccad9e5a8bede183ce63bbb7e78d)
-rw-r--r--hw/usb_cfs_client_common.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/hw/usb_cfs_client_common.c b/hw/usb_cfs_client_common.c
index 0a1990b..f03395c 100644
--- a/hw/usb_cfs_client_common.c
+++ b/hw/usb_cfs_client_common.c
@@ -187,13 +187,10 @@ static int cfs_set_gadget_strs(struct cfs_client *cfs_client,
static int cfs_ensure_dir(char *path)
{
- int ret;
-
- ret = mkdir(path, 0770);
- if (ret < 0)
- ret = errno == EEXIST ? 0 : errno;
+ if (mkdir(path, 0770) < 0)
+ return (errno == EEXIST) ? 0 : -errno;
- return ret;
+ return 0;
}