Commit f637408a authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

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: 's avatarDmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 70ca4ecd
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment