]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/message.c
Correct Qmsg() that was not updated correctly when committing a
[bacula/bacula] / bacula / src / lib / message.c
index 9b0f3069e58e04fa0a86de3f651cb481a2bbcba7..e4cef4e6ac1a5f005b7117d59c7443eba21a5940 100644 (file)
@@ -9,7 +9,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2007 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.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ * Bacula message handling routines
+ *
+ *   Kern Sibbald, April 2000
+ *
+ *   Version $Id$
+ *
+ */
 
 
 #include "bacula.h"
@@ -426,6 +434,7 @@ void close_msg(JCR *jcr)
          case MD_APPEND:
             if (d->fd) {
                fclose(d->fd);            /* close open file descriptor */
+               d->fd = NULL;
             }
             break;
          case MD_MAIL:
@@ -486,6 +495,7 @@ void close_msg(JCR *jcr)
 rem_temp_file:
             /* Remove temp file */
             fclose(d->fd);
+            d->fd = NULL;
             unlink(d->mail_filename);
             free_pool_memory(d->mail_filename);
             d->mail_filename = NULL;
@@ -747,6 +757,7 @@ send_to_file:
                 /* On error, we close and reopen to handle log rotation */
                 if (ferror(d->fd)) {
                    fclose(d->fd);
+                   d->fd = NULL;
                    if (open_dest_file(jcr, d, mode)) {
                       fputs(dt, d->fd);
                       fputs(msg, d->fd);