* sigproc.cc (child_info::child_info): Initialize msv_count.

This commit is contained in:
Christopher Faylor 2006-12-12 15:58:08 +00:00
parent 46b51548b1
commit a10c6f0312
2 changed files with 28 additions and 23 deletions

View File

@ -59,7 +59,7 @@
now always filled out. now always filled out.
* fork.cc (frok::parent): Move ch.zero manipulation to constructor. * fork.cc (frok::parent): Move ch.zero manipulation to constructor.
* spawn.cc (spawn_guts): Ditto. Remove _ch wrapper. * 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.cc (shared_info::heap_slop_size): Remove noisy system_printfs.
* shared_info.h (CURR_SHARED_MAGIC): Regenerate. * shared_info.h (CURR_SHARED_MAGIC): Regenerate.

View File

@ -3245,39 +3245,44 @@ funlockfile (FILE *file)
} }
extern "C" 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) if (*type == 'b' || *type == 't')
return NULL; type++;
int fd, other_fd, __stdin, __stdout, stdwhat; if ((rw != 'r' && rw != 'w') || (*type != '\0'))
if (type[1] != '\0')
{ {
set_errno (EINVAL); set_errno (EINVAL);
return NULL; 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; __stdin = -1;
stdwhat = 1; stdwhat = 1;
other_fd = __stdout = fds[1]; other_fd = __stdout = fds[1];
fd = fds[0]; fd = fds[0];
} break;
else if (*type == 'w') case 'w':
{
__stdout = -1; __stdout = -1;
stdwhat = 0; stdwhat = 0;
other_fd = __stdin = fds[0]; other_fd = __stdin = fds[0];
fd = fds[1]; fd = fds[1];
} break;
else default:
{ return NULL; /* avoid a compiler warning */
set_errno (EINVAL);
return NULL;
} }
FILE *fp = fdopen (fd, type); FILE *fp = fdopen (fd, in_type);
fcntl (fd, F_SETFD, fcntl (fd, F_GETFD, 0) | FD_CLOEXEC); fcntl (fd, F_SETFD, fcntl (fd, F_GETFD, 0) | FD_CLOEXEC);
if (!fp) if (!fp)