diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-07-17 09:52:53 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-07-17 16:53:36 +0000 |
commit | 2ca2cc16b1c4710726ba82908e735f5b27a95184 (patch) | |
tree | 003026a105fd610d0012138bc58380812bf6f79b /wiretap/erf.c | |
parent | dc9adf904b7e78af15edcd18b0ac00e93c093f9a (diff) |
Use time_t for the seconds part of a time stamp.
A packet time stamp is an nstime_t, and the seconds part of an nstime_t
is a time_t.
Change-Id: Id2452ceb2f33f43e4a040436d7b3ea1a5c4a0be3
Reviewed-on: https://code.wireshark.org/review/22673
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/erf.c')
-rw-r--r-- | wiretap/erf.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/wiretap/erf.c b/wiretap/erf.c index d7e846065d..56dd7334ca 100644 --- a/wiretap/erf.c +++ b/wiretap/erf.c @@ -90,8 +90,8 @@ typedef struct { guint64 prev_frame_ts; guint8 prev_erf_type; guint64 gen_time; - guint32 first_frame_time_sec; - guint32 prev_inserted_time_sec; + time_t first_frame_time_sec; + time_t prev_inserted_time_sec; gchar* user_comment_ptr; GPtrArray* periodic_sections; GArray *periodic_extra_ehdrs; @@ -1793,7 +1793,7 @@ static gboolean erf_dump( if(!dump_priv->gen_time) { erf_dump_priv_init_gen_time(dump_priv); - dump_priv->first_frame_time_sec = (guint32)phdr->ts.secs; + dump_priv->first_frame_time_sec = phdr->ts.secs; } if (encap != WTAP_ENCAP_ERF) { @@ -1911,7 +1911,7 @@ static gboolean erf_dump( } if (!erf_write_meta_record(wdh, dump_priv, dump_priv->prev_frame_ts, dump_priv->periodic_sections, dump_priv->periodic_extra_ehdrs, err)) return FALSE; - dump_priv->prev_inserted_time_sec = (guint32) phdr->ts.secs; + dump_priv->prev_inserted_time_sec = phdr->ts.secs; /*TODO: clear accumulated existing extension headers here?*/ } @@ -1922,7 +1922,7 @@ static gboolean erf_dump( * read. */ /* restart searching for next meta record to update capture comment at */ dump_priv->write_next_extra_meta = FALSE; - } else if (phdr->ts.secs > dump_priv->first_frame_time_sec + 1U + } else if (phdr->ts.secs > dump_priv->first_frame_time_sec + 1 && dump_priv->prev_inserted_time_sec != phdr->ts.secs) { /* For compatibility, don't insert metadata for older ERF files with no changed metadata */ if (dump_priv->write_next_extra_meta) { @@ -1940,7 +1940,7 @@ static gboolean erf_dump( * already) or the full metadata */ if (dump_priv->periodic_sections) { if (!erf_write_meta_record(wdh, dump_priv, (guint64)(phdr->ts.secs) << 32, dump_priv->periodic_sections, dump_priv->periodic_extra_ehdrs, err)) return FALSE; - dump_priv->prev_inserted_time_sec = (guint32) phdr->ts.secs; + dump_priv->prev_inserted_time_sec = phdr->ts.secs; } } } |