X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gbacktrace.c;h=4d0ba82ac49307d914e43486b59990c42a081ffb;hb=c9bd7542e1a28ba9de60048361c0a97d251833e7;hp=c1b5979e5deb0203ac0c8e99fe64bd2fda001654;hpb=2b688f549c8a2719544b33859cdc5ef99355cf37;p=platform%2Fupstream%2Fglib.git diff --git a/gbacktrace.c b/gbacktrace.c index c1b5979..4d0ba82 100644 --- a/gbacktrace.c +++ b/gbacktrace.c @@ -2,23 +2,23 @@ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ /* - * Modified by the GLib Team and others 1997-1999. See the AUTHORS + * Modified by the GLib Team and others 1997-2000. See the AUTHORS * file for a list of people on the GLib Team. See the ChangeLog * files for a list of changes. These files are distributed with * GLib at ftp://ftp.gtk.org/pub/gtk/. @@ -59,10 +59,9 @@ #include /* for bzero on BSD systems */ #endif -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 # define STRICT /* Strict typing, please */ # include -# include /* For _getpid() */ #endif #ifndef NO_FD_SET @@ -84,7 +83,7 @@ volatile gboolean glib_on_error_halt = TRUE; void g_on_error_query (const gchar *prg_name) { -#ifndef NATIVE_WIN32 +#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"; @@ -111,7 +110,10 @@ g_on_error_query (const gchar *prg_name) query3); fflush (stdout); - fgets (buf, 8, stdin); + if (isatty(0) && isatty(1)) + fgets (buf, 8, stdin); + else + strcpy (buf, "E\n"); if ((buf[0] == 'E' || buf[0] == 'e') && buf[1] == '\n') @@ -140,7 +142,7 @@ g_on_error_query (const gchar *prg_name) if (!prg_name) prg_name = g_get_prgname (); - MessageBox (NULL, "Terminating", + MessageBox (NULL, "g_on_error_query called, program terminating", (prg_name && *prg_name) ? prg_name : NULL, MB_OK|MB_ICONERROR); _exit(0); @@ -150,7 +152,7 @@ g_on_error_query (const gchar *prg_name) void g_on_error_stack_trace (const gchar *prg_name) { -#ifndef NATIVE_WIN32 +#ifdef G_OS_UNIX pid_t pid; gchar buf[16]; gchar *args[4] = { "gdb", NULL, NULL, NULL }; @@ -194,7 +196,7 @@ stack_trace_sigchld (int signum) static void stack_trace (char **args) { -#ifndef NATIVE_WIN32 +#ifdef G_OS_UNIX pid_t pid; int in_fd[2]; int out_fd[2];