projects
/
platform
/
upstream
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e7935e3
)
rfkill: Return the error when write() fails
author
Tomasz Bursztyka
<tomasz.bursztyka@linux.intel.com>
Tue, 9 Oct 2012 10:35:16 +0000
(13:35 +0300)
committer
Patrik Flykt
<patrik.flykt@linux.intel.com>
Tue, 16 Oct 2012 10:07:16 +0000
(13:07 +0300)
src/rfkill.c
patch
|
blob
|
history
diff --git
a/src/rfkill.c
b/src/rfkill.c
index
77c5b92
..
8d4c90d
100644
(file)
--- a/
src/rfkill.c
+++ b/
src/rfkill.c
@@
-165,7
+165,7
@@
int __connman_rfkill_block(enum connman_service_type type, connman_bool_t block)
uint8_t rfkill_type;
struct rfkill_event event;
ssize_t len;
- int fd;
+ int fd
, err
;
DBG("type %d block %d", type, block);
@@
-183,12
+183,15
@@
int __connman_rfkill_block(enum connman_service_type type, connman_bool_t block)
event.soft = block;
len = write(fd, &event, sizeof(event));
- if (len < 0)
+ if (len < 0)
{
connman_error("Failed to change RFKILL state");
+ err = len;
+ } else
+ err = 0;
close(fd);
- return
0
;
+ return
err
;
}
int __connman_rfkill_init(void)