Dmitry Timoshkov : schedsvc: Retry opening a .job file only in case of sharing violation.
Alexandre Julliard
julliard at winehq.org
Tue Jun 12 17:36:03 CDT 2018
Module: wine
Branch: master
Commit: f637408a23fb0c92e56f677ab1793b66f739b14d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=f637408a23fb0c92e56f677ab1793b66f739b14d
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Tue Jun 12 21:41:25 2018 +0800
schedsvc: Retry opening a .job file only in case of sharing violation.
And turn loud ERR() into a TRACE() like it is in other places.
Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/schedsvc/atsvc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/schedsvc/atsvc.c b/dlls/schedsvc/atsvc.c
index f6ea0f0..b8adc72 100644
--- a/dlls/schedsvc/atsvc.c
+++ b/dlls/schedsvc/atsvc.c
@@ -558,7 +558,7 @@ static BOOL load_job(const WCHAR *name, struct job_t *info)
if (file == INVALID_HANDLE_VALUE)
{
TRACE("Failed to open %s, error %u\n", debugstr_w(name), GetLastError());
- if (try++ >= 3) break;
+ if (GetLastError() != ERROR_SHARING_VIOLATION || try++ >= 3) break;
Sleep(100);
continue;
}
@@ -872,9 +872,9 @@ static void update_job_status(struct job_t *job)
hfile = CreateFileW(job->name, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
if (hfile != INVALID_HANDLE_VALUE) break;
- if (try++ >= 3)
+ if (GetLastError() != ERROR_SHARING_VIOLATION || try++ >= 3)
{
- ERR("Failed to update %s, error %u\n", debugstr_w(job->name), GetLastError());
+ TRACE("Failed to update %s, error %u\n", debugstr_w(job->name), GetLastError());
return;
}
Sleep(100);
More information about the wine-cvs
mailing list