]> mj.ucw.cz Git - maildups.git/commitdiff
die() now reports the correct program name
authorMartin Mares <mj@ucw.cz>
Fri, 19 Nov 2010 12:18:21 +0000 (13:18 +0100)
committerMartin Mares <mj@ucw.cz>
Fri, 19 Nov 2010 12:18:21 +0000 (13:18 +0100)
mdup.c
mrate.c
smail.c
util.c
util.h

diff --git a/mdup.c b/mdup.c
index 877d375fe0672e10c23a4294f6caed3afc017f7b..aefe3410d141b78750ab84fd98f88c66e8dd2f64 100644 (file)
--- a/mdup.c
+++ b/mdup.c
@@ -18,6 +18,8 @@
 
 #include "util.h"
 
+const char progname[] = "mdup";
+
 static char *db_name;
 static uns max_age = 86400;
 static uns now;
diff --git a/mrate.c b/mrate.c
index 5c76b002794f37ded63ffd60f9f99555deae539a..8caddf415fba25b5b23afea0af5d12b58b597b24 100644 (file)
--- a/mrate.c
+++ b/mrate.c
@@ -16,6 +16,8 @@
 
 #include "util.h"
 
+const char progname[] = "mrate";
+
 static char *db_name;
 
 static int db_fd;
diff --git a/smail.c b/smail.c
index c6cd7546f97aeea01304723144e05a022b128dd3..0e886f8e1c9c0aae06e71d53c5ab095886673b55 100644 (file)
--- a/smail.c
+++ b/smail.c
@@ -15,6 +15,8 @@
 
 #include "util.h"
 
+const char progname[] = "smail";
+
 static char *local_user;
 static char *local_domain;
 static char *from_user;
diff --git a/util.c b/util.c
index d3e24a155e926502ce4f3a59ccaff32593e58413..24837d8ca9a43e4763793326c80f9521281cdd73 100644 (file)
--- a/util.c
+++ b/util.c
@@ -18,7 +18,7 @@ die(char *c, ...)
 {
   va_list args;
   va_start(args, c);
-  fprintf(stderr, "mdup: ");
+  fprintf(stderr, "%s: ", progname);
   vfprintf(stderr, c, args);
   fputc('\n', stderr);
   va_end(args);
diff --git a/util.h b/util.h
index 66c78ce5720db3ff4932747e5b7ad99ecbd57eb4..cd1a132c1843ebbf61cff49e184b898a718c56b6 100644 (file)
--- a/util.h
+++ b/util.h
@@ -30,6 +30,7 @@ typedef uint64_t u64;
 /* util.c */
 
 extern int verbose;
+extern const char progname[];
 
 void NONRET die(char *x, ...);
 void verb(int level, char *x, ...);