diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2024-08-05 21:38:24 +0200 |
---|---|---|
committer | Christian Soffke <christian.soffke@gmail.com> | 2024-08-11 19:33:05 +0200 |
commit | 512f5561ba3b00cd54496c2b4e8a869dea1ec3ad (patch) | |
tree | 08c1e3ad066fca6b3a75f176d04fb16a21585a6a | |
parent | ce417b3e1bea6a18889965bafee4094d4dd3e083 (diff) | |
download | rockbox-512f5561ba.tar.gz rockbox-512f5561ba.zip |
fileop: Prevent poweroff during move
When overwriting an existing directory, the idle
power off timer may fire during the mass-renaming
of individual files.
Change-Id: Iedbc882c2470c32129a162d31dab8e5031a929b9
-rw-r--r-- | apps/fileop.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/fileop.c b/apps/fileop.c index 65a3b37e0a..bcd5202cf4 100644 --- a/apps/fileop.c +++ b/apps/fileop.c @@ -26,6 +26,7 @@ #include <string.h> #include "string-extra.h" #include "debug.h" +#include "powermgmt.h" #include "misc.h" #include "plugin.h" @@ -259,6 +260,7 @@ static int move_by_rename(struct file_op_params *src, { unsigned int flags = *pflags; int rc = FORC_UNKNOWN_FAILURE; + reset_poweroff_timer(); if (!(flags & (PASTE_COPY | PASTE_EXDEV))) { if ((flags & PASTE_OVERWRITE) || !file_exists(dst_path)) { /* Just try to move the directory / file */ |