diff options
author | INSUN PYO <insun.pyo@samsung.com> | 2020-03-26 07:29:34 +0900 |
---|---|---|
committer | Hyotaek Shim <hyotaek.shim@samsung.com> | 2020-03-26 01:24:41 +0000 |
commit | 8b2718ffda53041b5a5c4692178f052643cc2e95 (patch) | |
tree | e276a0e0320b4decd80a750409ac071b2a031977 | |
parent | 24cd219f7051a45d7c198fd34b12d441efc8e32c (diff) | |
download | libdevice-node-8b2718ffda53041b5a5c4692178f052643cc2e95.tar.gz libdevice-node-8b2718ffda53041b5a5c4692178f052643cc2e95.tar.bz2 libdevice-node-8b2718ffda53041b5a5c4692178f052643cc2e95.zip |
Fixed incorrect use of errno in usb cfs client
Change-Id: Ib091544138444c4108c7b09eb3e70e830661648e
(cherry picked from commit d8d490bd8049ccad9e5a8bede183ce63bbb7e78d)
-rw-r--r-- | hw/usb_cfs_client_common.c | 9 |
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; } |