From 404de093a118d4d5241c26d5a92c8a0378b411a0 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sat, 1 Apr 2023 18:40:10 +0800 Subject: [PATCH] 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 --- fs/fs_initialize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fs_initialize.c b/fs/fs_initialize.c index 513fc104b0f..44cf333e0d6 100644 --- a/fs/fs_initialize.c +++ b/fs/fs_initialize.c @@ -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(); }