summaryrefslogtreecommitdiff
path: root/wiretap/logcat_text.c
diff options
context:
space:
mode:
authorMichaƂ Orynicz <michal.orynicz@tieto.com>2014-08-08 09:06:38 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2014-08-08 08:12:10 +0000
commit735263e58e2a6a92389777d7baa2da2fa4d809a8 (patch)
treeda59f20630b56bfdcc6415e002e6561837388ce7 /wiretap/logcat_text.c
parentad4d6729765ac32013144109800b06d4d87b24ca (diff)
downloadwireshark-735263e58e2a6a92389777d7baa2da2fa4d809a8.tar.gz
Logcat text: small fixes
* fix exporting "beginning of" frame logs into info field * add missing "Failure" level to regexp in wiretap part * remove usage of GDateTime from wiretap part Change-Id: Ibdea730623241cccbbc1694a34daa308e48c0a89 Reviewed-on: https://code.wireshark.org/review/3493 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'wiretap/logcat_text.c')
-rw-r--r--wiretap/logcat_text.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/wiretap/logcat_text.c b/wiretap/logcat_text.c
index 5447474f0f..7d9cf4322f 100644
--- a/wiretap/logcat_text.c
+++ b/wiretap/logcat_text.c
@@ -34,7 +34,7 @@
#define SPECIAL_STRING "[-]+ beginning of \\/"
#define BRIEF_STRING "[IVDWEF]/.*\\( *\\d*\\): .*"
#define TAG_STRING "[IVDWEF]/.*: .*"
-#define TIME_STRING "\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3} [IVDWE]/.*\\( *\\d*\\): .*"
+#define TIME_STRING "\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3} [IVDWEF]/.*\\( *\\d*\\): .*"
#define THREAD_STRING "[IVDWEF]\\( *\\d+: *\\d+\\) .*"
#define PROCESS_STRING "[IVDWEF]\\( *\\d+\\) .*"
#define THREADTIME_STRING "\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3} *\\d+ *\\d+ [IVDWEF] .+: +"
@@ -156,18 +156,18 @@ static gchar *logcat_log(const struct dumper_t *dumper, guint32 seconds,
}
static void get_time(gchar *string, struct wtap_pkthdr *phdr) {
- gint day, month, hrs, min, sec, ms;
- GDateTime *date = NULL;
- gint64 seconds;
-
- if (6 == sscanf(string, "%d-%d %d:%d:%d.%d", &month, &day, &hrs, &min, &sec, &ms)) {
- date = g_date_time_new_local(1970, month, day, hrs, min,
- (gdouble) sec + ((gdouble) ms) * 0.001);
- seconds = g_date_time_to_unix(date);
+ gint ms;
+ struct tm date;
+ time_t seconds;
+
+ if (6 == sscanf(string, "%d-%d %d:%d:%d.%d", &date.tm_mon, &date.tm_mday, &date.tm_hour,
+ &date.tm_min, &date.tm_sec, &ms)) {
+ date.tm_year = 70;
+ date.tm_mon -= 1;
+ seconds = mktime(&date);
phdr->ts.secs = (time_t) seconds;
phdr->ts.nsecs = (int) (ms * 1e6);
phdr->presence_flags = WTAP_HAS_TS;
- g_date_time_unref(date);
} else {
phdr->presence_flags = 0;
phdr->ts.secs = (time_t) 0;