diff --git a/src/filed/dir_cmd.c b/src/filed/dir_cmd.c index 5097a903858..cf43663c5ea 100644 --- a/src/filed/dir_cmd.c +++ b/src/filed/dir_cmd.c @@ -422,6 +422,10 @@ static void *handle_director_connection(BSOCK *dir) const char jobname[12] = "*Director*"; // saveCWD save_cwd; +#ifdef HAVE_WIN32 + prevent_os_suspensions(); +#endif + jcr = new_jcr(sizeof(JCR), filed_free_jcr); /* create JCR */ jcr->dir_bsock = dir; jcr->ff = init_find_files(); @@ -541,6 +545,10 @@ static void *handle_director_connection(BSOCK *dir) Dsm_check(100); garbage_collect_memory_pool(); +#ifdef HAVE_WIN32 + allow_os_suspensions(); +#endif + return NULL; } diff --git a/src/win32/compat/compat.c b/src/win32/compat/compat.c index f3444ba8c2a..7b1b70778d4 100644 --- a/src/win32/compat/compat.c +++ b/src/win32/compat/compat.c @@ -2755,11 +2755,10 @@ void LogErrorMsg(const char *message) */ void prevent_os_suspensions() { - /* not in mingw */ -// SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED); + SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED); } void allow_os_suspensions() { -// SetThreadExecutionState(ES_CONTINUOUS); + SetThreadExecutionState(ES_CONTINUOUS); }