name-finder.h: Include <sys/wait.h>.
* include/name-finder.h: Include <sys/wait.h>. (_Jv_name_finder::pid): Now of type `pid_t'. (_Jv_name_finder::~_Jv_name_finder): Call waitpid(). * java/lang/Throwable.java (CPlusPlusDemangler.close): Call `proc.waitFor()'. From-SVN: r34279
This commit is contained in:
parent
270cea065e
commit
efc7058478
4 changed files with 26 additions and 7 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2000-05-30 Tom Tromey <tromey@cygnus.com>
|
||||||
|
|
||||||
|
* include/name-finder.h: Include <sys/wait.h>.
|
||||||
|
(_Jv_name_finder::pid): Now of type `pid_t'.
|
||||||
|
(_Jv_name_finder::~_Jv_name_finder): Call waitpid().
|
||||||
|
* java/lang/Throwable.java (CPlusPlusDemangler.close): Call
|
||||||
|
`proc.waitFor()'.
|
||||||
|
|
||||||
2000-05-24 Warren Levy <warrenl@cygnus.com>
|
2000-05-24 Warren Levy <warrenl@cygnus.com>
|
||||||
|
|
||||||
* java/io/ObjectOutputStream.java (writeObject): Use component type
|
* java/io/ObjectOutputStream.java (writeObject): Use component type
|
||||||
|
|
|
@ -17,6 +17,7 @@ details. */
|
||||||
#include <jvm.h>
|
#include <jvm.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -38,8 +39,12 @@ public:
|
||||||
#if defined (HAVE_PIPE) && defined (HAVE_FORK)
|
#if defined (HAVE_PIPE) && defined (HAVE_FORK)
|
||||||
close (f_pipe[1]);
|
close (f_pipe[1]);
|
||||||
fclose (b_pipe_fd);
|
fclose (b_pipe_fd);
|
||||||
|
|
||||||
|
int wstat;
|
||||||
|
// We don't care about errors here.
|
||||||
|
waitpid (pid, &wstat, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Given a pointer to a function or method, try to convert it into a
|
/* Given a pointer to a function or method, try to convert it into a
|
||||||
name and the appropriate line and source file. The caller passes
|
name and the appropriate line and source file. The caller passes
|
||||||
|
@ -60,10 +65,9 @@ public:
|
||||||
private:
|
private:
|
||||||
void toHex (void *p);
|
void toHex (void *p);
|
||||||
#if defined (HAVE_PIPE) && defined (HAVE_FORK)
|
#if defined (HAVE_PIPE) && defined (HAVE_FORK)
|
||||||
int pid;
|
pid_t pid;
|
||||||
int f_pipe[2], b_pipe[2];
|
int f_pipe[2], b_pipe[2];
|
||||||
FILE *b_pipe_fd;
|
FILE *b_pipe_fd;
|
||||||
int error;
|
int error;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -88,6 +88,13 @@ class CPlusPlusDemangler extends OutputStream
|
||||||
written++;
|
written++;
|
||||||
}
|
}
|
||||||
p.flush ();
|
p.flush ();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
proc.waitFor ();
|
||||||
|
}
|
||||||
|
catch (InterruptedException _)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ _Jv_name_finder::_Jv_name_finder (char *executable)
|
||||||
|
|
||||||
error |= pipe (f_pipe) < 0;
|
error |= pipe (f_pipe) < 0;
|
||||||
error |= pipe (b_pipe) < 0;
|
error |= pipe (b_pipe) < 0;
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -92,16 +92,16 @@ _Jv_name_finder::_Jv_name_finder (char *executable)
|
||||||
execvp (argv[0], argv);
|
execvp (argv[0], argv);
|
||||||
_exit (127);
|
_exit (127);
|
||||||
}
|
}
|
||||||
|
|
||||||
close (f_pipe [0]);
|
close (f_pipe [0]);
|
||||||
close (b_pipe [1]);
|
close (b_pipe [1]);
|
||||||
|
|
||||||
if (pid < 0)
|
if (pid < 0)
|
||||||
{
|
{
|
||||||
error |= 1;
|
error |= 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
b_pipe_fd = fdopen (b_pipe[0], "r");
|
b_pipe_fd = fdopen (b_pipe[0], "r");
|
||||||
error |= !b_pipe_fd;
|
error |= !b_pipe_fd;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue