]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/findlib/bfile.c
Second cut plugin filesets
[bacula/bacula] / bacula / src / findlib / bfile.c
index 3a984800299299719043348ea514a516bdce1b43..a338f2acc4c0895ffb709b297d7b7fe963449138 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2003-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2003-2010 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -32,8 +32,6 @@
  *
  *    Kern Sibbald, April MMIII
  *
- *   Version $Id$
- *
  */
 
 #include "bacula.h"
@@ -189,7 +187,9 @@ const char *stream_to_ascii(int stream)
    }
 }
 
-   
+/**   
+ *  Convert a 64 bit little endian to a big endian
+ */
 void int64_LE2BE(int64_t* pBE, const int64_t v)
 {
    /* convert little endian to big endian */
@@ -207,7 +207,9 @@ void int64_LE2BE(int64_t* pBE, const int64_t v)
    }    
 }
 
-
+/**
+ *  Convert a 32 bit little endian to a big endian
+ */
 void int32_LE2BE(int32_t* pBE, const int32_t v)
 {
    /* convert little endian to big endian */
@@ -226,6 +228,9 @@ void int32_LE2BE(int32_t* pBE, const int32_t v)
 }
 
 
+/**
+ *  Read a BackupRead block and pull out the file data
+ */
 bool processWin32BackupAPIBlock (BFILE *bfd, void *pBuffer, ssize_t dwSize)
 {
    /* pByte contains the buffer 
@@ -617,10 +622,6 @@ int bclose(BFILE *bfd)
 {
    int stat = 0;
 
-   if (bfd->errmsg) {
-      free_pool_memory(bfd->errmsg);
-      bfd->errmsg = NULL;
-   }
    if (bfd->mode == BF_CLOSED) {
       Dmsg0(50, "=== BFD already closed.\n");
       return 0;
@@ -668,6 +669,10 @@ int bclose(BFILE *bfd)
    }
 
 all_done:
+   if (bfd->errmsg) {
+      free_pool_memory(bfd->errmsg);
+      bfd->errmsg = NULL;
+   }
    bfd->mode = BF_CLOSED;
    bfd->lpContext = NULL;
    bfd->cmd_plugin = false;