Add some clarifying defines.
In order to be explicit in the Backtrace::Create() calls, adding a couple
of defines and some comments to describe what they mean.
Change-Id: I6ad08c529791821496a95fa33cea1c95b0a7eada
diff --git a/libbacktrace/Backtrace.cpp b/libbacktrace/Backtrace.cpp
index 17d9e1d..b22d301 100644
--- a/libbacktrace/Backtrace.cpp
+++ b/libbacktrace/Backtrace.cpp
@@ -213,13 +213,13 @@
}
Backtrace* Backtrace::Create(pid_t pid, pid_t tid) {
- if (pid < 0 || pid == getpid()) {
- if (tid < 0 || tid == gettid()) {
+ if (pid == BACKTRACE_CURRENT_PROCESS || pid == getpid()) {
+ if (tid == BACKTRACE_NO_TID || tid == gettid()) {
return CreateCurrentObj();
} else {
return CreateThreadObj(tid);
}
- } else if (tid < 0) {
+ } else if (tid == BACKTRACE_NO_TID) {
return CreatePtraceObj(pid, pid);
} else {
return CreatePtraceObj(pid, tid);