From: Kern Sibbald Date: Tue, 2 May 2006 07:12:03 +0000 (+0000) Subject: - Simplify Win32 Makefile X-Git-Tag: Release-7.0.0~8004 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fdef756cf9e2db6d23bd5b17e375438a8b6a39f5;p=bacula%2Fbacula - Simplify Win32 Makefile - Correct count of buffers/bytes used by smartall.c - Updated compat.h after porting apcupsd to MinGW. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2992 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index 45ebb2f1a1..6d9dc679f2 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -88,6 +88,9 @@ minutes). [ possibly a Python event -- kes ] === +- Directive: at "command" +- Command: pycmd "command" generates "command" event. How to + attach to a specific job? - Integrate Christopher's St. Bernard code. - run_cmd() returns int should return JobId_t - get_next_jobid_from_list() returns int should return JobId_t diff --git a/bacula/kes-1.39 b/bacula/kes-1.39 index 49fd0bdd29..c5fda47246 100644 --- a/bacula/kes-1.39 +++ b/bacula/kes-1.39 @@ -2,7 +2,11 @@ Kern Sibbald General: -01Ma06 +02May06 +- Simplify Win32 Makefile +- Correct count of buffers/bytes used by smartall.c +- Updated compat.h after porting apcupsd to MinGW. +01May06 - Work on getting wx-console building on MinGW. wxWidgets now builds started adding Makefile ... - Moved MinGW library objects to src/win32/lib to reduce clutter. diff --git a/bacula/src/lib/bshm.c b/bacula/src/lib/bshm.c index 4ba4db1658..41f62cf4d8 100644 --- a/bacula/src/lib/bshm.c +++ b/bacula/src/lib/bshm.c @@ -18,27 +18,22 @@ * available to all the threads. * */ - /* - Copyright (C) 2000-2004 Kern Sibbald and John Walker + Copyright (C) 2000-2006 Kern Sibbald This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License + version 2 as amended with additional clauses defined in the + file LICENSE in the main source directory. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. */ + #ifdef implemented #include "bacula.h" @@ -46,7 +41,7 @@ #if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32) #ifdef NEED_SHARED_MEMORY -#define SHM_KEY 0x0BACB01 /* key for shared memory */ +#define SHM_KEY 0x0BACB01 /* key for shared memory */ static key_t shmkey = SHM_KEY; #define MAX_TRIES 1000 @@ -66,9 +61,9 @@ void shm_create(BSHM *shm) Dmsg1(110, "shm_create size=%d\n", shm->size); for (i=0; isize, shm->perms | IPC_CREAT)) < 0) { - Emsg1(M_WARN, 0, _("shmget failure key = %x\n"), shmkey); - shmkey++; - continue; + Emsg1(M_WARN, 0, _("shmget failure key = %x\n"), shmkey); + shmkey++; + continue; } not_found = FALSE; break; @@ -78,10 +73,10 @@ void shm_create(BSHM *shm) shm->shmkey = shmkey; shm->shmid = shmid; Dmsg2(110, "shm_create return key=%x id=%d\n", shmkey, shmid); - shmkey++; /* leave set for next time */ + shmkey++; /* leave set for next time */ #else shm->shmbuf = NULL; - shm->shmkey = 0; /* reference count */ + shm->shmkey = 0; /* reference count */ #endif } @@ -108,7 +103,7 @@ void *shm_open(BSHM *shm) if (!shm->shmbuf) { shm->shmbuf = bmalloc(shm->size); } - shm->shmkey++; /* reference count */ + shm->shmkey++; /* reference count */ V(mutex); return shm->shmbuf; #endif @@ -120,12 +115,12 @@ void shm_close(BSHM *shm) #ifdef NEED_SHARED_MEMORY if (shm->size) { if (shmdt(shm->shmbuf) < 0) { - Emsg1(M_ERROR, 0, _("Error detaching shared memory: %s\n"), strerror(errno)); + Emsg1(M_ERROR, 0, _("Error detaching shared memory: %s\n"), strerror(errno)); } } #else P(mutex); - shm->shmkey--; /* reference count */ + shm->shmkey--; /* reference count */ V(mutex); #endif } @@ -136,7 +131,7 @@ void shm_destroy(BSHM *shm) #ifdef NEED_SHARED_MEMORY if (shm->size) { if (shmctl(shm->shmid, IPC_RMID, NULL) < 0) { - Emsg1(M_ERROR, 0, _("Could not destroy shared memory: %s\n"), strerror(errno)); + Emsg1(M_ERROR, 0, _("Could not destroy shared memory: %s\n"), strerror(errno)); } } #else diff --git a/bacula/src/lib/smartall.c b/bacula/src/lib/smartall.c index 7fe164f96c..5ad10e539a 100644 --- a/bacula/src/lib/smartall.c +++ b/bacula/src/lib/smartall.c @@ -188,8 +188,10 @@ void sm_free(const char *file, int line, void *fp) V(mutex); Emsg2(M_ABORT, 0, _("Buffer overrun called from %s:%d\n"), file, line); } - sm_buffers--; - sm_bytes -= head->ablen; + if (sm_buffers > 0) { + sm_buffers--; + sm_bytes -= head->ablen; + } qdchain(qp); V(mutex); @@ -283,8 +285,8 @@ void *sm_realloc(const char *fname, int lineno, void *ptr, unsigned int size) return NULL from realloc() and leave the buffer in PTR intact. */ - sm_buffers--; - sm_bytes -= head->ablen; +// sm_buffers--; +// sm_bytes -= head->ablen; if ((buf = smalloc(fname, lineno, size)) != NULL) { memcpy(buf, ptr, (int) sm_min(size, osize)); diff --git a/bacula/src/lib/winapi.c b/bacula/src/lib/winapi.c index 5f649edcc4..80fb5f7963 100644 --- a/bacula/src/lib/winapi.c +++ b/bacula/src/lib/winapi.c @@ -20,7 +20,11 @@ */ +#ifdef __APCUPSD__ +#include "apc.h" +#else #include "bacula.h" +#endif #if defined(HAVE_CYGWIN) || defined(HAVE_WIN32) diff --git a/bacula/src/version.h b/bacula/src/version.h index 5da1b34b88..d519c11b02 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "1.39.10" -#define BDATE "01 May 2006" -#define LSMDATE "01May06" +#define BDATE "02 May 2006" +#define LSMDATE "02May06" /* Debug flags */ #undef DEBUG