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@baikal.ru> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
70ca4ecd14
commit
f637408a23
|
@ -558,7 +558,7 @@ static BOOL load_job(const WCHAR *name, struct job_t *info)
|
||||||
if (file == INVALID_HANDLE_VALUE)
|
if (file == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
TRACE("Failed to open %s, error %u\n", debugstr_w(name), GetLastError());
|
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);
|
Sleep(100);
|
||||||
continue;
|
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);
|
hfile = CreateFileW(job->name, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
|
||||||
if (hfile != INVALID_HANDLE_VALUE) break;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
Sleep(100);
|
Sleep(100);
|
||||||
|
|
Loading…
Reference in New Issue