aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/adaint.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-06-17 15:14:44 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-06-17 15:14:44 +0200
commitaa9ea6a1ac7e1eb68bdc789ab6855e6bdca554f4 (patch)
tree43db9e38c43410e0eeefdcaa7825c5d85ca120ee /gcc/ada/adaint.c
parent498c378f90cfba11e114eca9284664b5ca4b151b (diff)
downloadgcc-aa9ea6a1ac7e1eb68bdc789ab6855e6bdca554f4.zip
gcc-aa9ea6a1ac7e1eb68bdc789ab6855e6bdca554f4.tar.gz
gcc-aa9ea6a1ac7e1eb68bdc789ab6855e6bdca554f4.tar.bz2
[multiple changes]
2010-06-17 Vincent Celier <celier@adacore.com> * gnatcmd.adb (Non_VMS_Usage): Do not issue usage for gnat sync. Update the last line of the usage, indicating what commands do not accept project file switches. * vms_conv.adb: Do not issue usage line for GNAT SYNC * vms_data.ads: Fix errors in the qualifiers /LOGFILE and /MAIN of GNAT ELIM. * gnat_ugn.texi: Document the relaxed rules for library directories in externally built library projects. 2010-06-17 Doug Rupp <rupp@adacore.com> * s-auxdec-vms_64.ads: Make boolean and arithmetic operations intrinsic where possible. * s-auxdec-vms-alpha.adb: Remove kludges for aforemention. * gcc-interface/Makefile.in: Update VMS target pairs. 2010-06-17 Vasiliy Fofanov <fofanov@adacore.com> * adaint.c: Reorganized in order to avoid use of GetProcessId to stay compatible with Windows NT 4.0 which doesn't provide this function. 2010-06-17 Vincent Celier <celier@adacore.com> * ali-util.adb (Time_Stamp_Mismatch): In Verbose mode, if there is different timestamps but the checksum is the same, issue a short message saying so. 2010-06-17 Arnaud Charlet <charlet@adacore.com> * s-interr.adb (Finalize): If the Abort_Task signal is set to system, it means that we cannot reset interrupt handlers since this would require potentially sending the abort signal to the Server_Task. From-SVN: r160911
Diffstat (limited to 'gcc/ada/adaint.c')
-rw-r--r--gcc/ada/adaint.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 54b3223..d73f63db 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -2474,7 +2474,7 @@ static HANDLE *HANDLES_LIST = NULL;
static int *PID_LIST = NULL, plist_length = 0, plist_max_length = 0;
static void
-add_handle (HANDLE h)
+add_handle (HANDLE h, int pid)
{
/* -------------------- critical section -------------------- */
@@ -2490,7 +2490,7 @@ add_handle (HANDLE h)
}
HANDLES_LIST[plist_length] = h;
- PID_LIST[plist_length] = GetProcessId (h);
+ PID_LIST[plist_length] = pid;
++plist_length;
(*Unlock_Task) ();
@@ -2521,8 +2521,8 @@ __gnat_win32_remove_handle (HANDLE h, int pid)
/* -------------------- critical section -------------------- */
}
-static HANDLE
-win32_no_block_spawn (char *command, char *args[])
+static void
+win32_no_block_spawn (char *command, char *args[], HANDLE *h, int *pid)
{
BOOL result;
STARTUPINFO SI;
@@ -2587,10 +2587,14 @@ win32_no_block_spawn (char *command, char *args[])
if (result == TRUE)
{
CloseHandle (PI.hThread);
- return PI.hProcess;
+ *h = PI.hProcess;
+ *pid = PI.dwProcessId;
}
else
- return NULL;
+ {
+ *h = NULL;
+ *pid = 0;
+ }
}
static int
@@ -2627,7 +2631,7 @@ win32_wait (int *status)
h = hl[res - WAIT_OBJECT_0];
GetExitCodeProcess (h, &exitcode);
- pid = GetProcessId (h);
+ pid = PID_LIST [res - WAIT_OBJECT_0];
__gnat_win32_remove_handle (h, -1);
free (hl);
@@ -2661,12 +2665,13 @@ __gnat_portable_no_block_spawn (char *args[])
#elif defined (_WIN32)
HANDLE h = NULL;
+ int pid;
- h = win32_no_block_spawn (args[0], args);
+ win32_no_block_spawn (args[0], args, &h, &pid);
if (h != NULL)
{
- add_handle (h);
- return GetProcessId (h);
+ add_handle (h, pid);
+ return pid;
}
else
return -1;