#include <sys/times.h>
#endif
#include <sys/types.h>
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
#include <time.h>
#ifdef HAVE_UNISTD_H
#include <sys/select.h>
#endif /* HAVE_SYS_SELECT_H */
-#ifdef STDC_HEADERS
#include <string.h> /* for bzero on BSD systems */
-#endif
#ifdef G_OS_WIN32
# define STRICT /* Strict typing, please */
g_on_error_query (const gchar *prg_name)
{
#ifndef G_OS_WIN32
- static const gchar *query1 = "[E]xit, [H]alt";
- static const gchar *query2 = ", show [S]tack trace";
- static const gchar *query3 = " or [P]roceed";
+ static const gchar * const query1 = "[E]xit, [H]alt";
+ static const gchar * const query2 = ", show [S]tack trace";
+ static const gchar * const query3 = " or [P]roceed";
gchar buf[16];
if (!prg_name)
pid_t pid;
gchar buf[16];
gchar *args[4] = { "gdb", NULL, NULL, NULL };
+ int status;
if (!prg_name)
return;
perror ("unable to fork gdb");
return;
}
-
- while (glib_on_error_halt)
- ;
- glib_on_error_halt = TRUE;
+
+ waitpid (pid, &status, 0);
#else
if (IsDebuggerPresent ())
G_BREAKPOINT ();