aboutsummaryrefslogtreecommitdiff
path: root/src/binlogcat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/binlogcat.c')
-rw-r--r--src/binlogcat.c34
1 files changed, 3 insertions, 31 deletions
diff --git a/src/binlogcat.c b/src/binlogcat.c
index 8cdfaaa..bdeb992 100644
--- a/src/binlogcat.c
+++ b/src/binlogcat.c
@@ -28,4 +28,4 @@
#include "pack.h"
+#include "err.h"
-char *progname;
char *timefmt = "%c";
@@ -36,30 +36,2 @@ int timediff_option;
void
-verror(const char *fmt, va_list ap)
-{
- fprintf(stderr, "%s: ", progname);
- vfprintf(stderr, fmt, ap);
- fputc('\n', stderr);
-}
-
-void
-error(const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- verror(fmt, ap);
- va_end(ap);
-}
-
-void
-packerror(const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- verror(fmt, ap);
- va_end(ap);
-}
-
-void
catlog(const char *fname)
@@ -100,3 +72,3 @@ catlog(const char *fname)
if (header.version != BINLOG_VERSION) {
- error("%s: unknown version", progname, fname);
+ error("%s: unknown version", fname);
exit(1);
@@ -178,5 +150,5 @@ main(int argc, char **argv)
{
- progname = argv[0];
int c;
+ setprogname(argv[0]);
while ((c = getopt(argc, argv, "dht:nv")) != EOF)

Return to:

Send suggestions and report system problems to the System administrator.