Propagate correct Windows error if executable can't be opened

* spawn.cc (av::setup): Set last Win32 error if NtOpenFile fails.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2016-03-17 17:46:11 +01:00
parent aa2d448093
commit 4c9bb3e0f9
1 changed files with 1 additions and 0 deletions

View File

@ -1085,6 +1085,7 @@ av::setup (const char *prog_arg, path_conv& real_path, const char *ext,
real_path.set_cygexec (true);
break;
}
SetLastError (RtlNtStatusToDosError (status));
goto err;
}
if (!GetFileSizeEx (h, &size))