[glib] Use g_abort() instead of abort() where possible
- From: Руслан Ижбулатов <ruslanizhb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Use g_abort() instead of abort() where possible
- Date: Wed, 27 Apr 2016 13:18:19 +0000 (UTC)
commit e47904a26f399d3870e22fbfaefab5d1ab6a7e23
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date: Wed Mar 30 14:01:30 2016 +0000
Use g_abort() instead of abort() where possible
https://bugzilla.gnome.org/show_bug.cgi?id=665446
glib/gbacktrace.c | 2 +-
glib/giowin32.c | 14 +++++++-------
glib/gmessages.c | 4 ++--
glib/gtester.c | 2 +-
glib/gtestutils.c | 6 +++---
glib/gthread-posix.c | 7 ++++---
glib/gthread-win32.c | 2 +-
7 files changed, 19 insertions(+), 18 deletions(-)
---
diff --git a/glib/gbacktrace.c b/glib/gbacktrace.c
index c59d18e..d231b5a 100644
--- a/glib/gbacktrace.c
+++ b/glib/gbacktrace.c
@@ -254,7 +254,7 @@ g_on_error_stack_trace (const gchar *prg_name)
if (IsDebuggerPresent ())
G_BREAKPOINT ();
else
- abort ();
+ g_abort ();
#endif
}
diff --git a/glib/giowin32.c b/glib/giowin32.c
index b839e94..27bb30f 100644
--- a/glib/giowin32.c
+++ b/glib/giowin32.c
@@ -798,7 +798,7 @@ g_io_win32_prepare (GSource *source,
default:
g_assert_not_reached ();
- abort ();
+ g_abort ();
}
if (channel->debug)
g_print ("\n");
@@ -945,7 +945,7 @@ g_io_win32_check (GSource *source)
default:
g_assert_not_reached ();
- abort ();
+ g_abort ();
}
}
@@ -1010,7 +1010,7 @@ g_io_win32_finalize (GSource *source)
default:
g_assert_not_reached ();
- abort ();
+ g_abort ();
}
if (channel->debug)
g_print ("\n");
@@ -1299,7 +1299,7 @@ g_io_win32_fd_seek (GIOChannel *channel,
default:
whence = -1; /* Keep the compiler quiet */
g_assert_not_reached ();
- abort ();
+ g_abort ();
}
tmp_offset = offset;
@@ -1694,7 +1694,7 @@ g_io_channel_new_file (const gchar *filename,
break;
default:
g_assert_not_reached ();
- abort ();
+ g_abort ();
}
/* always open 'untranslated' */
@@ -1740,7 +1740,7 @@ g_io_channel_new_file (const gchar *filename,
break;
default:
g_assert_not_reached ();
- abort ();
+ g_abort ();
}
return channel;
@@ -2229,7 +2229,7 @@ g_io_channel_win32_make_pollfd (GIOChannel *channel,
default:
g_assert_not_reached ();
- abort ();
+ g_abort ();
}
fd->events = condition;
diff --git a/glib/gmessages.c b/glib/gmessages.c
index 6720a26..744aa66 100644
--- a/glib/gmessages.c
+++ b/glib/gmessages.c
@@ -324,7 +324,7 @@ _g_log_abort (gboolean breakpoint)
if (breakpoint)
G_BREAKPOINT ();
else
- abort ();
+ g_abort ();
}
#ifdef G_OS_WIN32
@@ -1190,7 +1190,7 @@ g_assert_warning (const char *log_domain,
line,
pretty_function);
_g_log_abort (FALSE);
- abort ();
+ g_abort ();
}
/**
diff --git a/glib/gtester.c b/glib/gtester.c
index 0f0cc11..cff1cf9 100644
--- a/glib/gtester.c
+++ b/glib/gtester.c
@@ -94,7 +94,7 @@ static void
terminate (void)
{
kill (getpid(), SIGTERM);
- abort();
+ g_abort();
}
static void
diff --git a/glib/gtestutils.c b/glib/gtestutils.c
index 5b91505..a767607 100644
--- a/glib/gtestutils.c
+++ b/glib/gtestutils.c
@@ -846,7 +846,7 @@ g_test_log (GTestLogType lbit,
{
if (test_tap_log)
g_print ("Bail out!\n");
- abort();
+ g_abort();
}
if (result == G_TEST_RUN_SKIPPED)
test_skipped_count++;
@@ -2426,7 +2426,7 @@ g_assertion_message (const char *domain,
_exit (1);
}
else
- abort ();
+ g_abort ();
}
/**
@@ -2459,7 +2459,7 @@ g_assertion_message_expr (const char *domain,
if (test_in_subprocess)
_exit (1);
else
- abort ();
+ g_abort ();
}
void
diff --git a/glib/gthread-posix.c b/glib/gthread-posix.c
index 9e49e9c..71a6b7b 100644
--- a/glib/gthread-posix.c
+++ b/glib/gthread-posix.c
@@ -46,6 +46,7 @@
#include "gmessages.h"
#include "gstrfuncs.h"
#include "gmain.h"
+#include "gutils.h"
#include <stdlib.h>
#include <stdio.h>
@@ -74,7 +75,7 @@ g_thread_abort (gint status,
{
fprintf (stderr, "GLib (gthread-posix.c): Unexpected error from C library during '%s': %s. Aborting.\n",
function, strerror (status));
- abort ();
+ g_abort ();
}
/* {{{1 GMutex */
@@ -1296,7 +1297,7 @@ g_mutex_clear (GMutex *mutex)
if G_UNLIKELY (mutex->i[0] != 0)
{
fprintf (stderr, "g_mutex_clear() called on uninitialised or locked mutex\n");
- abort ();
+ g_abort ();
}
}
@@ -1322,7 +1323,7 @@ g_mutex_unlock_slowpath (GMutex *mutex,
if G_UNLIKELY (prev == 0)
{
fprintf (stderr, "Attempt to unlock mutex that was not locked\n");
- abort ();
+ g_abort ();
}
syscall (__NR_futex, &mutex->i[0], (gsize) FUTEX_WAKE_PRIVATE, (gsize) 1, NULL);
diff --git a/glib/gthread-win32.c b/glib/gthread-win32.c
index 8395acd..e917fac 100644
--- a/glib/gthread-win32.c
+++ b/glib/gthread-win32.c
@@ -58,7 +58,7 @@ g_thread_abort (gint status,
{
fprintf (stderr, "GLib (gthread-win32.c): Unexpected error from C library during '%s': %s. Aborting.\n",
strerror (status), function);
- abort ();
+ g_abort ();
}
/* Starting with Vista and Windows 2008, we have access to the
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]