summaryrefslogtreecommitdiffstats
path: root/debuggerd
diff options
context:
space:
mode:
authorBrigid Smith <brigidsmith@google.com>2014-07-17 14:52:33 -0700
committerElliott Hughes <enh@google.com>2014-07-29 16:08:34 -0700
commit166cfe68c3b0212f8e9714a0acd470d488817093 (patch)
tree28d9595c44375815b6369ea174b067c7962b1934 /debuggerd
parenta6ff5c95a3fa798d661e09aa628cd0c5e5c8608f (diff)
downloadsystem_core-166cfe68c3b0212f8e9714a0acd470d488817093.zip
system_core-166cfe68c3b0212f8e9714a0acd470d488817093.tar.gz
system_core-166cfe68c3b0212f8e9714a0acd470d488817093.tar.bz2
Added default constructor for log_t.
Bug: 16357258 (cherry picked from commit c75a02fe3f9abec006a1e88794f2fa12fbeafd8f) Change-Id: I96be34ee1664af54b0dcbc928ea542cd749852fd
Diffstat (limited to 'debuggerd')
-rw-r--r--debuggerd/utility.cpp2
-rw-r--r--debuggerd/utility.h7
2 files changed, 7 insertions, 2 deletions
diff --git a/debuggerd/utility.cpp b/debuggerd/utility.cpp
index a163344..9a30fe3 100644
--- a/debuggerd/utility.cpp
+++ b/debuggerd/utility.cpp
@@ -59,6 +59,8 @@ bool is_allowed_in_logcat(enum logtype ltype) {
void _LOG(log_t* log, enum logtype ltype, const char* fmt, ...) {
bool write_to_tombstone = (log->tfd != -1);
bool write_to_logcat = is_allowed_in_logcat(ltype)
+ && log->crashed_tid != -1
+ && log->current_tid != -1
&& (log->crashed_tid == log->current_tid);
bool write_to_activitymanager = (log->amfd != -1);
diff --git a/debuggerd/utility.h b/debuggerd/utility.h
index 518305d..31684ce 100644
--- a/debuggerd/utility.h
+++ b/debuggerd/utility.h
@@ -37,7 +37,7 @@
#endif
-typedef struct {
+struct log_t{
/* tombstone file descriptor */
int tfd;
/* Activity Manager socket file descriptor */
@@ -46,7 +46,10 @@ typedef struct {
pid_t crashed_tid;
// The tid of the thread we are currently working with.
pid_t current_tid;
-} log_t;
+
+ log_t()
+ : tfd(-1), amfd(-1), crashed_tid(-1), current_tid(-1) {}
+};
// List of types of logs to simplify the logging decision in _LOG
enum logtype {