OSDN Git Service

ts_calibrate : Truncate pointercal file if it already exists. jb-x86 kitkat-x86
authorMasaki Muranaka <monaka@monami-ya.jp>
Mon, 12 Aug 2013 14:40:06 +0000 (23:40 +0900)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 13 Aug 2013 15:43:08 +0000 (23:43 +0800)
This fix is partly done by 1fd999ec678e. But not completed.

Signed-off-by: Masaki Muranaka <monaka@monami-ya.jp>
tests/ts_calibrate.c

index d8ceb5b..4b5ce6d 100644 (file)
@@ -277,7 +277,7 @@ int main()
                        cal_fd = open (calfile, O_CREAT | O_TRUNC | O_RDWR,
                                       S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
                } else if (tset != NULL) {
-                       cal_fd = open (tset->calfile, O_CREAT | O_RDWR,
+                       cal_fd = open (tset->calfile, O_CREAT | O_TRUNC | O_RDWR,
                                       S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
                } else {
                        cal_fd = open (TS_POINTERCAL, O_CREAT | O_TRUNC | O_RDWR,