* sigproc.cc (child_info::child_info): Initialize msv_count.
This commit is contained in:
parent
46b51548b1
commit
a10c6f0312
|
@ -59,7 +59,7 @@
|
|||
now always filled out.
|
||||
* fork.cc (frok::parent): Move ch.zero manipulation to constructor.
|
||||
* spawn.cc (spawn_guts): Ditto. Remove _ch wrapper.
|
||||
* sigproc.cc (child_info::child_info): Initialize starter[].
|
||||
* sigproc.cc (child_info::child_info): Initialize msv_count.
|
||||
|
||||
* shared.cc (shared_info::heap_slop_size): Remove noisy system_printfs.
|
||||
* shared_info.h (CURR_SHARED_MAGIC): Regenerate.
|
||||
|
|
|
@ -3245,39 +3245,44 @@ funlockfile (FILE *file)
|
|||
}
|
||||
|
||||
extern "C" FILE *
|
||||
popen (const char *command, const char *type)
|
||||
popen (const char *command, const char *in_type)
|
||||
{
|
||||
int fds[2];
|
||||
const char *type = in_type;
|
||||
char rw = *type++;
|
||||
|
||||
if (pipe (fds) < 0)
|
||||
return NULL;
|
||||
int fd, other_fd, __stdin, __stdout, stdwhat;
|
||||
if (type[1] != '\0')
|
||||
if (*type == 'b' || *type == 't')
|
||||
type++;
|
||||
if ((rw != 'r' && rw != 'w') || (*type != '\0'))
|
||||
{
|
||||
set_errno (EINVAL);
|
||||
return NULL;
|
||||
}
|
||||
if (*type == 'r')
|
||||
|
||||
int fd, other_fd, __stdin, __stdout, stdwhat;
|
||||
|
||||
int fds[2];
|
||||
if (pipe (fds) < 0)
|
||||
return NULL;
|
||||
|
||||
switch (rw)
|
||||
{
|
||||
case 'r':
|
||||
__stdin = -1;
|
||||
stdwhat = 1;
|
||||
other_fd = __stdout = fds[1];
|
||||
fd = fds[0];
|
||||
}
|
||||
else if (*type == 'w')
|
||||
{
|
||||
break;
|
||||
case 'w':
|
||||
__stdout = -1;
|
||||
stdwhat = 0;
|
||||
other_fd = __stdin = fds[0];
|
||||
fd = fds[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
set_errno (EINVAL);
|
||||
return NULL;
|
||||
break;
|
||||
default:
|
||||
return NULL; /* avoid a compiler warning */
|
||||
}
|
||||
|
||||
FILE *fp = fdopen (fd, type);
|
||||
FILE *fp = fdopen (fd, in_type);
|
||||
fcntl (fd, F_SETFD, fcntl (fd, F_GETFD, 0) | FD_CLOEXEC);
|
||||
|
||||
if (!fp)
|
||||
|
|
Loading…
Reference in New Issue