fs: Flush the file system cache in BOARDIOC_POWEROFF too

and remove the check of SYS_DOWN since it defines to SYS_RESTART in reboot_notifer.h:
  #define SYS_DOWN        0x0001     /* Notify of system down */
  #define SYS_RESTART     SYS_DOWN
  #define SYS_HALT        0x0002     /* Notify of system halt */
  #define SYS_POWER_OFF   0x0003     /* Notify of system power off */

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-04-01 18:40:10 +08:00 committed by Petro Karashchenko
parent b737d410b9
commit 404de093a1

View File

@ -40,7 +40,7 @@
static int sync_reboot_handler(FAR struct notifier_block *nb,
unsigned long action, FAR void *data)
{
if (action == SYS_DOWN || action == SYS_RESTART)
if (action == SYS_POWER_OFF || action == SYS_RESTART)
{
sync();
}