OSDN Git Service
(root)
/
android-x86
/
hardware-intel-libsensors.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into mr1
[android-x86/hardware-intel-libsensors.git]
/
accel-calibration.c
diff --git
a/accel-calibration.c
b/accel-calibration.c
index
8a21a05
..
9367774
100644
(file)
--- a/
accel-calibration.c
+++ b/
accel-calibration.c
@@
-201,7
+201,8
@@
void accel_cal_store (int s)
fd = open(ACCEL_CALIBRATION_PATH, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR);
- write(fd, cal_data, sizeof(accel_cal_t));
-
- close(fd);
+ if (fd != -1) {
+ write(fd, cal_data, sizeof(accel_cal_t));
+ close(fd);
+ }
}