mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-14 14:55:41 +00:00
Merge from OpenBSD up to rev 1.5 (matches NetBSD up to rev 1.3):
* Clean up waitpid parameter handling.
This commit is contained in:
parent
bac210578d
commit
ec10002d16
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=43928
@ -190,9 +190,8 @@ system(command)
|
||||
const char *command;
|
||||
{
|
||||
static char *name, *shell;
|
||||
union wait pstat;
|
||||
pid_t pid;
|
||||
int omask;
|
||||
int omask, pstat;
|
||||
sig_t intsave, quitsave;
|
||||
|
||||
if (shell == NULL) {
|
||||
@ -217,11 +216,11 @@ system(command)
|
||||
}
|
||||
intsave = signal(SIGINT, SIG_IGN);
|
||||
quitsave = signal(SIGQUIT, SIG_IGN);
|
||||
pid = waitpid(pid, (int *)&pstat, 0);
|
||||
pid = waitpid(pid, &pstat, 0);
|
||||
(void)sigsetmask(omask);
|
||||
(void)signal(SIGINT, intsave);
|
||||
(void)signal(SIGQUIT, quitsave);
|
||||
return(pid == -1 ? -1 : pstat.w_status);
|
||||
return(pid == -1 ? -1 : pstat);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user