diff --git a/src/common.c b/src/common.c index b502d52..75b2d42 100644 --- a/src/common.c +++ b/src/common.c @@ -18,6 +18,12 @@ progname_set(char *name) progname = name; } +const char * +progname_get(void) +{ + return progname; +} + void enable_debug(void) { diff --git a/src/common.h b/src/common.h index 0892230..b665f3d 100644 --- a/src/common.h +++ b/src/common.h @@ -11,6 +11,7 @@ extern int is_debug_enabled; /* Debug macros */ void progname_set(char *name); +const char *progname_get(void); void enable_debug(void); void verr(const char *prefix, const char *func, const char *errstr, ...); void vdie(const char *prefix, const char *func, const char *errstr, ...); diff --git a/src/emu/ovnisync.c b/src/emu/ovnisync.c index 97008b1..9fd9da5 100644 --- a/src/emu/ovnisync.c +++ b/src/emu/ovnisync.c @@ -11,10 +11,9 @@ #include #include #include +#include "common.h" #include "ovni.h" -const char progname[] = "ovnisync"; - struct offset { /* All in nanoseconds */ double delta_mean; @@ -441,6 +440,8 @@ do_work(struct options *options, int rank) int main(int argc, char *argv[]) { + progname_set("ovnisync"); + MPI_Init(&argc, &argv); int rank;