Author: cwittich
Date: Thu Mar 6 17:54:08 2008
New Revision: 32589
URL:
http://svn.reactos.org/svn/reactos?rev=3D32589&view=3Drev
Log:
replace execv with CreateProcess because we have to wait for the process
Modified:
trunk/tools/RosBE/RosBE-Windows/Tools/ccache-2.4/ccache.c
Modified: trunk/tools/RosBE/RosBE-Windows/Tools/ccache-2.4/ccache.c
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Too=
ls/ccache-2.4/ccache.c?rev=3D32589&r1=3D32588&r2=3D32589&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/tools/RosBE/RosBE-Windows/Tools/ccache-2.4/ccache.c (original)
+++ trunk/tools/RosBE/RosBE-Windows/Tools/ccache-2.4/ccache.c Thu Mar 6 17=
:54:08 2008
@@ -125,6 +125,9 @@
static void failed(void)
{
char *e;
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ char* merged =3D build_command(orig_args->argv);
=
/* delete intermediate pre-processor file if needed */
if (i_tmpfile) {
@@ -154,10 +157,23 @@
args_add_prefix(orig_args, p);
}
=
- execv(orig_args->argv[0], orig_args->argv);
- cc_log("execv returned (%s)!\n", strerror(errno));
- perror(orig_args->argv[0]);
- exit(1);
+ ZeroMemory(&si, sizeof(STARTUPINFO));
+ ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
+
+ si.cb =3D sizeof(STARTUPINFO);
+
+ if(!CreateProcessA(orig_args->argv[0], merged, NULL, NULL, FALSE, 0, NULL=
, NULL, &si, &pi))
+ {
+ perror(orig_args->argv[0]);
+ exit(1);
+ }
+
+ WaitForSingleObject( pi.hProcess, INFINITE );
+
+ CloseHandle( pi.hProcess );
+ CloseHandle( pi.hThread );
+
+ exit(0);
}
=
=