projects
/
platform
/
adaptation
/
pass-hal-standard.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6ff332
)
pass-hal: standard: Fix the return value when accessing sysfs interface
65/226065/1
accepted/tizen/unified/20200228.123655
submit/tizen/20200228.012941
author
Chanwoo Choi
<cw00.choi@samsung.com>
Wed, 26 Feb 2020 10:16:52 +0000
(19:16 +0900)
committer
Chanwoo Choi
<cw00.choi@samsung.com>
Wed, 26 Feb 2020 10:17:10 +0000
(19:17 +0900)
Change-Id: I59a67537f664f9bd91b4dda1ea1ac6d91defa73e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/shared/sysfs.c
patch
|
blob
|
history
diff --git
a/src/shared/sysfs.c
b/src/shared/sysfs.c
index 1256076622589421629828a8210428eb912d6c35..23768ce46ab19af7dd0e8d683601d1668cb73f86 100644
(file)
--- a/
src/shared/sysfs.c
+++ b/
src/shared/sysfs.c
@@
-38,7
+38,9
@@
static int sysfs_read_buf(char *path, char *buf, int len)
r = read(fd, buf, len);
close(fd);
- if ((r < 0) || (r > len))
+ if (r < 0)
+ return r;
+ if (r > len)
return -EIO;
buf[r] = '\0';
@@
-61,7
+63,7
@@
static int sysfs_write_buf(char *path, char *buf)
close(fd);
if (w < 0)
- return
-EIO
;
+ return
w
;
return 0;
}