if (!ok)
err = (unsigned) GetLastError ();
- return true;
+ return ok;
});
if (err.has_value ())
windows_init_thread_list ();
do_synchronously ([&] ()
{
- if (!create_process (nullptr, args, flags, w32_env,
- inferior_cwd != nullptr ? infcwd : nullptr,
- disable_randomization,
- &si, &pi))
+ BOOL ok = create_process (nullptr, args, flags, w32_env,
+ inferior_cwd != nullptr ? infcwd : nullptr,
+ disable_randomization,
+ &si, &pi);
+
+ if (!ok)
ret = (unsigned) GetLastError ();
- return true;
+
+ return ok;
});
if (w32_env)
windows_init_thread_list ();
do_synchronously ([&] ()
{
- if (!create_process (nullptr, /* image */
- args, /* command line */
- flags, /* start flags */
- w32env, /* environment */
- inferior_cwd, /* current directory */
- disable_randomization,
- &si,
- &pi))
+ BOOL ok = create_process (nullptr, /* image */
+ args, /* command line */
+ flags, /* start flags */
+ w32env, /* environment */
+ inferior_cwd, /* current directory */
+ disable_randomization,
+ &si,
+ &pi);
+ if (!ok)
ret = (unsigned) GetLastError ();
- return true;
+
+ return ok;
});
if (tty != INVALID_HANDLE_VALUE)
CloseHandle (tty);