summaryrefslogtreecommitdiff
path: root/apps/fileop.c
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2024-08-05 21:38:24 +0200
committerChristian Soffke <christian.soffke@gmail.com>2024-08-11 19:33:05 +0200
commit512f5561ba3b00cd54496c2b4e8a869dea1ec3ad (patch)
tree08c1e3ad066fca6b3a75f176d04fb16a21585a6a /apps/fileop.c
parentce417b3e1bea6a18889965bafee4094d4dd3e083 (diff)
downloadrockbox-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.c2
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 */