Use common's progname functions in ovnisync

This commit adds the progname_get function in common.h header and
extends the ovnisync tool to use them
This commit is contained in:
Kevin Sala 2023-10-17 18:20:06 +02:00 committed by Rodrigo Arias Mallo
parent 3ea89edac7
commit 24252ebbb3
3 changed files with 10 additions and 2 deletions

View File

@ -18,6 +18,12 @@ progname_set(char *name)
progname = name; progname = name;
} }
const char *
progname_get(void)
{
return progname;
}
void void
enable_debug(void) enable_debug(void)
{ {

View File

@ -11,6 +11,7 @@ extern int is_debug_enabled;
/* Debug macros */ /* Debug macros */
void progname_set(char *name); void progname_set(char *name);
const char *progname_get(void);
void enable_debug(void); void enable_debug(void);
void verr(const char *prefix, const char *func, const char *errstr, ...); void verr(const char *prefix, const char *func, const char *errstr, ...);
void vdie(const char *prefix, const char *func, const char *errstr, ...); void vdie(const char *prefix, const char *func, const char *errstr, ...);

View File

@ -11,10 +11,9 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
#include "common.h"
#include "ovni.h" #include "ovni.h"
const char progname[] = "ovnisync";
struct offset { struct offset {
/* All in nanoseconds */ /* All in nanoseconds */
double delta_mean; double delta_mean;
@ -441,6 +440,8 @@ do_work(struct options *options, int rank)
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
progname_set("ovnisync");
MPI_Init(&argc, &argv); MPI_Init(&argc, &argv);
int rank; int rank;