From 9d20a4ec3e0263cf241611e46d1dcfe684244474 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 24 Dec 2007 17:34:30 +0000 Subject: [PATCH] kes Fix compile warning in src/lib/util.c kes Fix entry point for edit_job_codes() so that Win32 builds. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6136 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/dird_conf.c | 2 +- bacula/src/lib/protos.h | 2 ++ bacula/src/lib/util.c | 2 +- bacula/technotes-2.3 | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index e0b52f3aa2..b96bb36453 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -1899,7 +1899,7 @@ static void store_runscript(LEX *lc, RES_ITEM *item, int index, int pass) } /* callback function for edit_job_codes */ -char *job_code_callback_filesetname(JCR *jcr, const char* param) +extern "C" char *job_code_callback_filesetname(JCR *jcr, const char* param) { if (param[0] == 'f') { return jcr->fileset->name(); diff --git a/bacula/src/lib/protos.h b/bacula/src/lib/protos.h index 161ba6ee24..e77832c233 100644 --- a/bacula/src/lib/protos.h +++ b/bacula/src/lib/protos.h @@ -301,7 +301,9 @@ bool get_tls_enable (TLS_CONTEXT *ctx); /* util.c */ +extern "C" { typedef char *(*job_code_callback_t)(JCR *, const char *); +} bool is_buf_zero (char *buf, int len); void lcase (char *str); diff --git a/bacula/src/lib/util.c b/bacula/src/lib/util.c index 1a15ecf6f1..d88714f436 100644 --- a/bacula/src/lib/util.c +++ b/bacula/src/lib/util.c @@ -496,7 +496,7 @@ void make_session_key(char *key, char *seed, int mode) char *p; p = s; - sprintf(s + strlen(s), "%lu", (uint32_t)GetCurrentProcessId()); + bsnprintf(s + strlen(s), ss, "%lu", (uint32_t)GetCurrentProcessId()); (void)getcwd(s + strlen(s), 256); bsnprintf(s + strlen(s), ss, "%lu", (uint32_t)GetTickCount()); QueryPerformanceCounter(&li); diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index fd47158c78..4622e6839c 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -2,6 +2,8 @@ General: 24Dec07 +kes Fix compile warning in src/lib/util.c +kes Fix entry point for edit_job_codes() so that Win32 builds. kes Fix seg fault Frank Sweetser reports in regression testing on his systems. The problem was that the original author of bsnprintf.c did not take into account the side effects of -- 2.39.5