mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
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
This commit is contained in:
parent
ce417b3e1b
commit
512f5561ba
1 changed files with 2 additions and 0 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue