]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/bshm.c
Fix OPENSSL include in lib and findlib
[bacula/bacula] / bacula / src / lib / bshm.c
index d6c7b3ae8f4ecb49d79e99325c9d14c4c330bafc..4ba4db165810abe6b316fe7e8b2eff335aaa0957 100644 (file)
@@ -4,7 +4,7 @@
  * To avoid problems with several return arguments, we
  * pass a packet.
  *
- *  BSHM definition is in bshm.h  
+ *  BSHM definition is in bshm.h
  *
  *  By Kern Sibbald, May MM
  *
@@ -20,7 +20,7 @@
  */
 
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -39,6 +39,8 @@
 
  */
 
+#ifdef implemented
+
 #include "bacula.h"
 
 #if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32)
@@ -64,20 +66,20 @@ 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);
+        Emsg1(M_WARN, 0, _("shmget failure key = %x\n"), shmkey);
         shmkey++;
         continue;
       }
       not_found = FALSE;
       break;
    }
-   if (not_found) 
-      Emsg2(M_ABORT, 0, "Could not get %d bytes of shared memory: %s\n", shm->size, strerror(errno));
+   if (not_found)
+      Emsg2(M_ABORT, 0, _("Could not get %d bytes of shared memory: %s\n"), shm->size, strerror(errno));
    shm->shmkey = shmkey;
    shm->shmid = shmid;
    Dmsg2(110, "shm_create return key=%x id=%d\n", shmkey, shmid);
    shmkey++;                         /* leave set for next time */
-#else 
+#else
    shm->shmbuf = NULL;
    shm->shmkey = 0;                  /* reference count */
 #endif
@@ -94,10 +96,10 @@ void *shm_open(BSHM *shm)
    if ((shmid = shmget(shm->shmkey, shm->size, 0)) < 0)
       Emsg2(M_ABORT, 0, "Could not get %d bytes of shared memory: %s\n", shm->size, strerror(errno));
    Dmsg1(110, "shm_open shmat with id=%d\n", shmid);
-   shmbuf = shmat(shmid, NULL, 0);     
+   shmbuf = shmat(shmid, NULL, 0);
    Dmsg1(110, "shm_open buf=%x\n", shmbuf);
    if (shmbuf == (char *) -1)
-      Emsg1(M_ABORT, 0, "Could not attach shared memory: %s\n", strerror(errno));
+      Emsg1(M_ABORT, 0, _("Could not attach shared memory: %s\n"), strerror(errno));
    shm->shmbuf = shmbuf;
    shm->shmid = shmid;
    return shmbuf;
@@ -118,7 +120,7 @@ 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
@@ -134,7 +136,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
@@ -149,3 +151,5 @@ void shm_destroy(BSHM *shm)
 }
 
 #endif /* ! HAVE_CYGWIN */
+
+#endif