summaryrefslogtreecommitdiffstats
path: root/firmware/target
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-03-16 00:07:48 +0000
committerSolomon Peachy <pizza@shaftnet.org>2022-03-31 21:40:04 -0400
commit412dbaeffe1bf864ff3f2c8bba9312bb034fa126 (patch)
tree7e1d45ce90ce87e76e7d05064269d055848465ea /firmware/target
parenta9e02b485094b2a4851eb7a2ee33f3a6eac51e95 (diff)
downloadrockbox-412dbaeffe1bf864ff3f2c8bba9312bb034fa126.tar.gz
rockbox-412dbaeffe1bf864ff3f2c8bba9312bb034fa126.zip
hosted: call 'sync' before poweroff
Might be needed to avoid filesystem corruption with buggy OF kernels. Change-Id: I589eec6c1536beccf849716f11204b4b83a942a1
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/hosted/system-hosted.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/firmware/target/hosted/system-hosted.c b/firmware/target/hosted/system-hosted.c
index ce47fd5f5c..c4ae5a404f 100644
--- a/firmware/target/hosted/system-hosted.c
+++ b/firmware/target/hosted/system-hosted.c
@@ -90,6 +90,7 @@ static void sig_handler(int sig, siginfo_t *siginfo, void *context)
void power_off(void)
{
backlight_hw_off();
+ sync();
system("/sbin/poweroff");
while (1); /* halt */
}