From: Alain Spineux Date: Wed, 20 May 2020 11:48:29 +0000 (+0200) Subject: make_unique_filename() now use "const char *key" X-Git-Tag: Release-11.3.2~979 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afb4e852d5305ce3416b7b129eeec09169c2dd15;p=thirdparty%2Fbacula.git make_unique_filename() now use "const char *key" --- diff --git a/bacula/src/dird/ua_dotcmds.c b/bacula/src/dird/ua_dotcmds.c index 1d4b88d49..d63e3d936 100644 --- a/bacula/src/dird/ua_dotcmds.c +++ b/bacula/src/dird/ua_dotcmds.c @@ -1670,7 +1670,7 @@ static bool putfile_cmd(UAContext *ua, const char *cmd) } /* the (intptr_t)ua will allow one file per console session */ - make_unique_filename(&name, (intptr_t)ua, (char *)key); + make_unique_filename(&name, (intptr_t)ua, key); fp = bfopen(name, "w"); if (!fp) { diff --git a/bacula/src/lib/bsys.c b/bacula/src/lib/bsys.c index 72539ffda..97bf72980 100644 --- a/bacula/src/lib/bsys.c +++ b/bacula/src/lib/bsys.c @@ -942,7 +942,7 @@ char *bfgets(POOLMEM *&s, FILE *fd) * without saving its name, and re-generate the name * so that it can be deleted. */ -void make_unique_filename(POOLMEM **name, int Id, char *what) +void make_unique_filename(POOLMEM **name, int Id, const char *what) { Mmsg(name, "%s/%s.%s.%d.tmp", working_directory, my_name, what, Id); } diff --git a/bacula/src/lib/ini.c b/bacula/src/lib/ini.c index d20ed6411..0c9b0ab32 100644 --- a/bacula/src/lib/ini.c +++ b/bacula/src/lib/ini.c @@ -178,7 +178,7 @@ bool ConfigFile::dump_string(const char *buf, int32_t len) if (!out_fname) { out_fname = get_pool_memory(PM_FNAME); - make_unique_filename(&out_fname, (int)(intptr_t)this, (char*)"configfile"); + make_unique_filename(&out_fname, (int)(intptr_t)this, "configfile"); } fp = bfopen(out_fname, "wb"); diff --git a/bacula/src/lib/protos.h b/bacula/src/lib/protos.h index 51fbe3483..38b69ffba 100644 --- a/bacula/src/lib/protos.h +++ b/bacula/src/lib/protos.h @@ -110,7 +110,7 @@ int change_job_user(char *uname, char *gname, char *errmsg, int errlen); int bmicrosleep (int32_t sec, int32_t usec); char *bfgets (char *s, int size, FILE *fd); char *bfgets (POOLMEM *&s, FILE *fd); -void make_unique_filename (POOLMEM **name, int Id, char *what); +void make_unique_filename (POOLMEM **name, int Id, const char *what); #ifndef HAVE_STRTOLL long long int strtoll (const char *ptr, char **endptr, int base); #endif