* pexecute.c (pexecute) [__MSDOS__]: Change __GO32__ to
__DJGPP__. Use P_WAIT instead of constant in the spawnv* call. Cast program to 'char *' in errmsg_arg assignment. (PWAIT_ERROR): Define. (pwait): Use PWAIT_ERROR. Adjust DJGPP's status code to conform to DJGPP's WIF* macros.
This commit is contained in:
parent
6e8008398d
commit
a9f34fb652
2 changed files with 24 additions and 5 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2000-07-26 Mark Elbrecht <snowball3@bigfoot.com>
|
||||||
|
|
||||||
|
* pexecute.c (pexecute) [__MSDOS__]: Change __GO32__ to
|
||||||
|
__DJGPP__. Use P_WAIT instead of constant in the spawnv* call.
|
||||||
|
Cast program to 'char *' in errmsg_arg assignment.
|
||||||
|
(PWAIT_ERROR): Define.
|
||||||
|
(pwait): Use PWAIT_ERROR. Adjust DJGPP's status code to conform
|
||||||
|
to DJGPP's WIF* macros.
|
||||||
|
|
||||||
2000-07-27 RodneyBrown <RodneyBrown@pmsc.com>
|
2000-07-27 RodneyBrown <RodneyBrown@pmsc.com>
|
||||||
Jeff Law <law@cygnus.com>
|
Jeff Law <law@cygnus.com>
|
||||||
|
|
||||||
|
|
|
@ -157,9 +157,9 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
|
||||||
if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE)
|
if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE)
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
#ifdef __GO32__
|
#ifdef __DJGPP__
|
||||||
/* ??? What are the possible return values from spawnv? */
|
/* ??? What are the possible return values from spawnv? */
|
||||||
rc = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (1, program, argv);
|
rc = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (P_WAIT, program, argv);
|
||||||
#else
|
#else
|
||||||
char *scmd, *rf;
|
char *scmd, *rf;
|
||||||
FILE *argfile;
|
FILE *argfile;
|
||||||
|
@ -208,7 +208,7 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
|
||||||
if (rc == -1)
|
if (rc == -1)
|
||||||
{
|
{
|
||||||
*errmsg_fmt = install_error_msg;
|
*errmsg_fmt = install_error_msg;
|
||||||
*errmsg_arg = program;
|
*errmsg_arg = (char *)program;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,6 +217,13 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
|
||||||
return last_pid;
|
return last_pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Use ECHILD if available, otherwise use EINVAL. */
|
||||||
|
#ifdef ECHILD
|
||||||
|
#define PWAIT_ERROR ECHILD
|
||||||
|
#else
|
||||||
|
#define PWAIT_ERROR EINVAL
|
||||||
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
pwait (pid, status, flags)
|
pwait (pid, status, flags)
|
||||||
int pid;
|
int pid;
|
||||||
|
@ -228,13 +235,16 @@ pwait (pid, status, flags)
|
||||||
/* Called twice for the same child? */
|
/* Called twice for the same child? */
|
||||||
|| pid == last_reaped)
|
|| pid == last_reaped)
|
||||||
{
|
{
|
||||||
/* ??? ECHILD would be a better choice. Can we use it here? */
|
errno = PWAIT_ERROR;
|
||||||
errno = EINVAL;
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* ??? Here's an opportunity to canonicalize the values in STATUS.
|
/* ??? Here's an opportunity to canonicalize the values in STATUS.
|
||||||
Needed? */
|
Needed? */
|
||||||
|
#ifdef __DJGPP__
|
||||||
|
*status = (last_status >> 8);
|
||||||
|
#else
|
||||||
*status = last_status;
|
*status = last_status;
|
||||||
|
#endif
|
||||||
last_reaped = last_pid;
|
last_reaped = last_pid;
|
||||||
return last_pid;
|
return last_pid;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue