Delete temp files 69/199969/1
authorSeungyoun Ju <sy39.ju@samsung.com>
Thu, 8 Nov 2018 08:51:03 +0000 (17:51 +0900)
committerSeungyoun Ju <sy39.ju@samsung.com>
Mon, 18 Feb 2019 03:08:58 +0000 (12:08 +0900)
commit9e186399cff36bb1ae43be5132c5c065508258ab
treebcab80e445ef19f4875f2bca1daf4a90ed748ea8
parent0d18bb1b14cbb850ba18429a6523c33db40b1200
Delete temp files

[Problem] Storage directory's size becomes huge (over 6MB)
 after infinite rebooting test.
[Cause & Measure] Over 1,500 temp files were created as followings.
 g_file_contents_set() creates temp file and writes contents to it. After that,
 rename temp file to destination file for atomic operation. If a device turned
 off before renaming, temp file remains and never be deleted.
 This patch deletes temp files before creating temp files.

4.0K    /opt/var/lib/bluetooth/FC:A6:21:B2:E1:7B/settings.CKX5BZ
4.0K    /opt/var/lib/bluetooth/FC:A6:21:B2:E1:7B/settings.OA76BZ
4.0K    /opt/var/lib/bluetooth/FC:A6:21:B2:E1:7B/settings.1BFTBZ
4.0K    /opt/var/lib/bluetooth/FC:A6:21:B2:E1:7B/settings.3CB9BZ

[Checking Method] Reboot device while booting

Change-Id: Ie159ef06eab6295b1f40514e4dde386a512eb5d1
src/adapter.c