mirror of https://github.com/GNOME/gimp.git
Bug 795510 - SYS_gettid is not available on non-Linux system.
I could not find for sure what to use on FreeBSD instead, so let's just not get this information there. It is quite useful information to know where thread traces were asked from, but it is more important to make sure the program can be compiled everywhere. Also we can just check which thread has gimp_stack_trace*() calls. Thus it can be seen as redundant information in any case. SYS_gettid is apparently defined as a macro, so let's simply check for it being defined.
This commit is contained in:
parent
44a931e16c
commit
106fc9309f
|
@ -1178,7 +1178,7 @@ gimp_stack_trace_print (const gchar *prog_name,
|
|||
pid_t pid = getpid();
|
||||
#if defined(G_OS_WIN32)
|
||||
DWORD tid = GetCurrentThreadId ();
|
||||
#else
|
||||
#elif defined(SYS_gettid)
|
||||
long tid = syscall (SYS_gettid);
|
||||
#endif
|
||||
|
||||
|
@ -1272,16 +1272,20 @@ gimp_stack_trace_print (const gchar *prog_name,
|
|||
{
|
||||
if (! stack_printed)
|
||||
{
|
||||
#if defined(G_OS_WIN32) || defined(SYS_gettid)
|
||||
if (stream)
|
||||
g_fprintf (stream,
|
||||
"\n# Stack traces obtained from PID %d - Thread %lu #\n\n",
|
||||
pid, tid);
|
||||
#endif
|
||||
if (trace)
|
||||
{
|
||||
gtrace = g_string_new (NULL);
|
||||
#if defined(G_OS_WIN32) || defined(SYS_gettid)
|
||||
g_string_printf (gtrace,
|
||||
"\n# Stack traces obtained from PID %d - Thread %lu #\n\n",
|
||||
pid, tid);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
/* It's hard to know if the debugger was found since it
|
||||
|
|
Loading…
Reference in New Issue