How to close file handles gracefully during "reboot" command ?
i have a linux embedded system, no NAND flash, only uses SD card for storage.
Our app has several processes, they open database files and consistently working on them.
Now if you press the reset button, or "reboot" cmd from console, the next time we see database file corruption. My guess is our app is not closing file handles gracefully.
Our software reset button gives app a little bit time to clean up, how can i check the opened file handles at this point ? Can i have a separate process and close these file handles in other processes by that file handle hex value ?