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 /apps/fileop.c | |
parent | ce417b3e1bea6a18889965bafee4094d4dd3e083 (diff) | |
download | rockbox-512f5561ba3b00cd54496c2b4e8a869dea1ec3ad.tar.gz rockbox-512f5561ba3b00cd54496c2b4e8a869dea1ec3ad.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
Diffstat (limited to 'apps/fileop.c')
-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 @@ | |||
26 | #include <string.h> | 26 | #include <string.h> |
27 | #include "string-extra.h" | 27 | #include "string-extra.h" |
28 | #include "debug.h" | 28 | #include "debug.h" |
29 | #include "powermgmt.h" | ||
29 | 30 | ||
30 | #include "misc.h" | 31 | #include "misc.h" |
31 | #include "plugin.h" | 32 | #include "plugin.h" |
@@ -259,6 +260,7 @@ static int move_by_rename(struct file_op_params *src, | |||
259 | { | 260 | { |
260 | unsigned int flags = *pflags; | 261 | unsigned int flags = *pflags; |
261 | int rc = FORC_UNKNOWN_FAILURE; | 262 | int rc = FORC_UNKNOWN_FAILURE; |
263 | reset_poweroff_timer(); | ||
262 | if (!(flags & (PASTE_COPY | PASTE_EXDEV))) { | 264 | if (!(flags & (PASTE_COPY | PASTE_EXDEV))) { |
263 | if ((flags & PASTE_OVERWRITE) || !file_exists(dst_path)) { | 265 | if ((flags & PASTE_OVERWRITE) || !file_exists(dst_path)) { |
264 | /* Just try to move the directory / file */ | 266 | /* Just try to move the directory / file */ |