This repository was archived by the owner on Jun 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 5353# include < sys/ucontext.h>
5454#endif
5555#ifdef HAVE_UNISTD_H
56+ # include < unistd.h>
57+ #endif
58+ #if defined (HAVE_SYS_SYSCALL_H) && defined (HAVE_SYS_TYPES_H)
5659# include < sys/syscall.h>
5760# include < sys/types.h>
58- # include < unistd.h>
5961#endif
6062
6163namespace google {
@@ -218,16 +220,15 @@ void DumpSignalInfo(int signal_number, siginfo_t* siginfo) {
218220 std::ostringstream oss;
219221 oss << std::showbase << std::hex << std::this_thread::get_id ();
220222 formatter.AppendString (oss.str ().c_str ());
221-
222- formatter.AppendString (" ) " );
223-
224- // Only linux has the PID of the signal sender in si_pid.
225- # ifdef GLOG_OS_LINUX
223+ #if defined (GLOG_OS_LINUX) && defined (HAVE_SYS_SYSCALL_H) && defined (HAVE_SYS_TYPES_H)
226224 pid_t tid = syscall (SYS_gettid);
227- formatter.AppendString (" ( LWP " );
225+ formatter.AppendString (" LWP " );
228226 formatter.AppendUint64 (tid, 10 );
227+ # endif
229228 formatter.AppendString (" ) " );
230229
230+ // Only linux has the PID of the signal sender in si_pid.
231+ # ifdef GLOG_OS_LINUX
231232 formatter.AppendString (" from PID " );
232233 formatter.AppendUint64 (static_cast <uint64>(siginfo->si_pid ), 10 );
233234 formatter.AppendString (" ; " );
You can’t perform that action at this time.
0 commit comments