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;
}
const char *
progname_get(void)
{
return progname;
}
void
enable_debug(void)
{

View File

@ -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, ...);

View File

@ -11,10 +11,9 @@
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
#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;