From 512f5561ba3b00cd54496c2b4e8a869dea1ec3ad Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Mon, 5 Aug 2024 21:38:24 +0200 Subject: 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 --- apps/fileop.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'apps') 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 #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 */ -- cgit v1.2.3