]> git.sur5r.net Git - bacula/bacula/commitdiff
- Simplify Win32 Makefile
authorKern Sibbald <kern@sibbald.com>
Tue, 2 May 2006 07:12:03 +0000 (07:12 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 2 May 2006 07:12:03 +0000 (07:12 +0000)
- 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

bacula/kernstodo
bacula/kes-1.39
bacula/src/lib/bshm.c
bacula/src/lib/smartall.c
bacula/src/lib/winapi.c
bacula/src/version.h

index 45ebb2f1a1f03f78d1784d9a18b231b74eb852c9..6d9dc679f21b956ce1b39d31748dc5f2c0af6b7c 100644 (file)
@@ -88,6 +88,9 @@ minutes).
 
 [ possibly a Python event -- kes ]
 ===
+- Directive: at <event> "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
index 49fd0bdd2939d90a1c7a215be53cc8a4c293cc5b..c5fda472468d07d6122ee2e4de3c416ece69546b 100644 (file)
@@ -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.
index 4ba4db165810abe6b316fe7e8b2eff335aaa0957..41f62cf4d8373b0b886e9e61c004e82dd11aa36b 100644 (file)
  *  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; i<MAX_TRIES; i++) {
       if ((shmid = shmget(shmkey, shm->size, 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
index 7fe164f96c695a4675d08fac69f5287df6a0fca4..5ad10e539a9f5ae88c24adf1fdeb29b26bb9c3b3 100644 (file)
@@ -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));
index 5f649edcc43101e422bb4fa2d6e1203a46fa0d66..80fb5f79634722445cff4bab5f114bfde161eb67 100644 (file)
 
  */
 
+#ifdef __APCUPSD__
+#include "apc.h"
+#else
 #include "bacula.h"
+#endif
 
 #if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
 
index 5da1b34b88cca9b518f7fa728fb59ede11b77a8d..d519c11b02065737a01e6f74f136eaf7dffb3b87 100644 (file)
@@ -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