diff options
author | Sergey Poznyakoff <gray@nxc.no> | 2014-06-01 15:32:25 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@nxc.no> | 2014-06-01 15:34:19 +0200 |
commit | 6054989b78b7a481770a1608c809a56e1cf5cc7d (patch) | |
tree | 23404bef612baef8fbc97364b012496cf0db9c7b /src/binlogsel.c | |
parent | 6c0f32b6f37bbb70445731988b5ac180ef054357 (diff) | |
download | vmod-binlog-6054989b78b7a481770a1608c809a56e1cf5cc7d.tar.gz vmod-binlog-6054989b78b7a481770a1608c809a56e1cf5cc7d.tar.bz2 |
Fix -d (timediff) option in binlogsel.
* src/binlogsel.c (selmem): Don't attempt to modify rec.
Diffstat (limited to 'src/binlogsel.c')
-rw-r--r-- | src/binlogsel.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/binlogsel.c b/src/binlogsel.c index d44c1b8..b3fb75b 100644 --- a/src/binlogsel.c +++ b/src/binlogsel.c @@ -275,4 +275,4 @@ selmem(const char *name, void *base) { - struct binlog_file_header *hdr; - struct binlog_record *rec; + struct binlog_file_header const *hdr; + struct binlog_record const *rec; struct packenv *env; @@ -352,2 +352,4 @@ selmem(const char *name, void *base) for (i = 0; start < hdr->recnum; i++, start++) { + time_t ts; + rec = getrec(base, hdr->recsize, start); @@ -356,2 +358,4 @@ selmem(const char *name, void *base) break; + + ts = rec->ts; @@ -359,4 +363,4 @@ selmem(const char *name, void *base) if (i == 0) - start_ts = rec->ts; - rec->ts -= start_ts; + start_ts = ts; + ts -= start_ts; } @@ -374,3 +378,3 @@ selmem(const char *name, void *base) if (module_record) - module_record(ip->name, rec->ts, env->buf_base); + module_record(ip->name, ts, env->buf_base); else { |