From 549b13b867fdcd5c87afdcf595f3cf80bc0d90a6 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 26 Nov 2008 17:59:54 +0000 Subject: [PATCH] Fix win32 build, not without some pain git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8088 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/filed/job.c | 8 ++++---- bacula/src/filed/status.c | 4 ++-- bacula/src/lib/mem_pool.h | 8 +++++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index 8d0cf550e4..e258fce8ad 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -1267,7 +1267,7 @@ static int level_cmd(JCR *jcr) goto bail_out; } since_time = str_to_uint64(buf); /* this is the since time */ - Dmsg1(100, "since_time=%d\n", (int)since_time); + Dmsg1(100, "since_time=%lld\n", since_time); char ed1[50], ed2[50]; /* * Sync clocks by polling him for the time. We take @@ -1309,10 +1309,10 @@ static int level_cmd(JCR *jcr) } dir->signal(BNET_EOD); - Dmsg2(100, "adj = %d since_time=%d\n", (int)adj, (int)since_time); + Dmsg2(100, "adj = %d since_time=%lld\n", (int)adj, since_time); jcr->incremental = 1; /* set incremental or decremental backup */ - jcr->mtime = (time_t)since_time; /* set since time */ - generate_plugin_event(jcr, bEventSince, (void *)jcr->mtime); + jcr->mtime = since_time; /* set since time */ + generate_plugin_event(jcr, bEventSince, (void *)(time_t)jcr->mtime); } else { Jmsg1(jcr, M_FATAL, 0, _("Unknown backup level: %s\n"), level); free_memory(level); diff --git a/bacula/src/filed/status.c b/bacula/src/filed/status.c index aa55a87323..4ee3c13685 100644 --- a/bacula/src/filed/status.c +++ b/bacula/src/filed/status.c @@ -340,8 +340,8 @@ static void sendit(const char *msg, int len, STATUS_PKT *sp) { if (sp->bs) { BSOCK *user = sp->bs; - - pm_memcpy(user->msg, msg, len+1); + user->msg = check_pool_memory_size(user->msg, len+1); + memcpy(user->msg, msg, len+1); user->msglen = len+1; user->send(); } else { diff --git a/bacula/src/lib/mem_pool.h b/bacula/src/lib/mem_pool.h index abb4daeba3..942e3cd45b 100644 --- a/bacula/src/lib/mem_pool.h +++ b/bacula/src/lib/mem_pool.h @@ -107,13 +107,15 @@ int pm_strcat(POOLMEM **pm, const char *str); int pm_strcat(POOLMEM *&pm, const char *str); int pm_strcat(POOL_MEM &pm, const char *str); int pm_strcat(POOLMEM *&pm, POOL_MEM &str); + int pm_strcpy(POOLMEM **pm, const char *str); int pm_strcpy(POOLMEM *&pm, const char *str); int pm_strcpy(POOL_MEM &pm, const char *str); int pm_strcpy(POOLMEM *&pm, POOL_MEM &str); -int pm_memcpy(POOLMEM **pm, const void *data, size_t n); -int pm_memcpy(POOLMEM *&pm, const void *data, size_t n); -int pm_memcpy(POOL_MEM &pm, const void *data, size_t n); + +int pm_memcpy(POOLMEM **pm, const char *data, size_t n); +int pm_memcpy(POOLMEM *&pm, const char *data, size_t n); +int pm_memcpy(POOL_MEM &pm, const char *data, size_t n); int pm_memcpy(POOLMEM *&pm, POOL_MEM &data, size_t n); #endif -- 2.39.5