diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-10-15 21:12:32 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-10-15 21:12:32 +0300 |
commit | 340802898d02bad367efc8f8ba1517d42fe4baad (patch) | |
tree | 8e3300600ddf02fd9d19d8c11a45b5eb87ba9717 /src/binlogcat.c | |
parent | 2afd00cc2bdbaa401edc7117965b3db658576719 (diff) | |
download | vmod-binlog-340802898d02bad367efc8f8ba1517d42fe4baad.tar.gz vmod-binlog-340802898d02bad367efc8f8ba1517d42fe4baad.tar.bz2 |
Minor change
Use 'format' instead of 'dataspec'
Diffstat (limited to 'src/binlogcat.c')
-rw-r--r-- | src/binlogcat.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/binlogcat.c b/src/binlogcat.c index 6ab3daf..bc7df6c 100644 --- a/src/binlogcat.c +++ b/src/binlogcat.c | |||
@@ -43,7 +43,7 @@ catlog(const char *fname) | |||
43 | char timebuf[128]; | 43 | char timebuf[128]; |
44 | size_t i; | 44 | size_t i; |
45 | time_t start_ts; | 45 | time_t start_ts; |
46 | char *dataspec; | 46 | char *format; |
47 | size_t size; | 47 | size_t size; |
48 | struct packenv *env; | 48 | struct packenv *env; |
49 | struct packinst *inst; | 49 | struct packinst *inst; |
@@ -76,9 +76,9 @@ catlog(const char *fname) | |||
76 | } | 76 | } |
77 | 77 | ||
78 | size = header.hdrsize - sizeof(header); | 78 | size = header.hdrsize - sizeof(header); |
79 | dataspec = xmalloc(size); | 79 | format = xmalloc(size); |
80 | 80 | ||
81 | if (fread(dataspec, size, 1, fp) != 1) { | 81 | if (fread(format, size, 1, fp) != 1) { |
82 | error("error reading header of %s: %s", | 82 | error("error reading header of %s: %s", |
83 | fname, strerror(errno)); | 83 | fname, strerror(errno)); |
84 | exit(1); | 84 | exit(1); |
@@ -86,20 +86,20 @@ catlog(const char *fname) | |||
86 | 86 | ||
87 | if (verbose_option) | 87 | if (verbose_option) |
88 | printf("# %s; format=%s; recsize=%lu; recnum=%lu\n", | 88 | printf("# %s; format=%s; recsize=%lu; recnum=%lu\n", |
89 | fname, dataspec, (unsigned long) header.recsize, | 89 | fname, format, (unsigned long) header.recsize, |
90 | (unsigned long) header.recnum); | 90 | (unsigned long) header.recnum); |
91 | 91 | ||
92 | inst = packcomp(dataspec, &p); | 92 | inst = packcomp(format, &p); |
93 | if (!inst) { | 93 | if (!inst) { |
94 | if (errno == EINVAL) { | 94 | if (errno == EINVAL) { |
95 | error("%s: %s: bad dataspec near %s", fname, dataspec, p); | 95 | error("%s: %s: bad format near %s", fname, format, p); |
96 | exit(1); | 96 | exit(1); |
97 | } | 97 | } |
98 | 98 | ||
99 | error("%s", strerror(errno)); | 99 | error("%s", strerror(errno)); |
100 | exit(1); | 100 | exit(1); |
101 | } | 101 | } |
102 | free(dataspec); | 102 | free(format); |
103 | 103 | ||
104 | rec = xmalloc(header.recsize); | 104 | rec = xmalloc(header.recsize); |
105 | env = packenv_create(header.recsize - | 105 | env = packenv_create(header.recsize - |