]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/findlib/create_file.c
Update doc
[bacula/bacula] / bacula / src / findlib / create_file.c
index 2900f998d9c0eee9a01cac18062cb9d7438a4344..500061d25a1eb343516d9ed41e8f5213d93467b3 100644 (file)
@@ -7,7 +7,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2003 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
@@ -170,13 +170,16 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace)
            mode |= O_CTG;               /* set contiguous bit if needed */
         }
          Dmsg1(50, "Create file: %s\n", attr->ofname);
+        if (is_bopen(bfd)) {
+            Jmsg1(jcr, M_ERROR, 0, "bpkt already open fid=%d\n", bfd->fid);
+        }
         if ((bopen(bfd, attr->ofname, mode, S_IRUSR | S_IWUSR)) < 0) {
             Jmsg2(jcr, M_ERROR, 0, _("Could not create %s: ERR=%s\n"), 
                  attr->ofname, berror(bfd));
            return CF_ERROR;
         }
         return CF_EXTRACT;
-
+#ifndef HAVE_WIN32  // none of these exists on MS Windows
       case FT_RAW:                   /* Bacula raw device e.g. /dev/sda1 */
       case FT_FIFO:                  /* Bacula fifo to save data */
       case FT_SPEC:                     
@@ -196,7 +199,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace)
            }
         }       
         if (attr->type == FT_RAW || attr->type == FT_FIFO) {
-           btimer_id tid;
+           btimer_t *tid;
             Dmsg1(200, "FT_RAW|FT_FIFO %s\n", attr->ofname);
            mode =  O_WRONLY | O_BINARY;
            /* Timeout open() in 60 seconds */
@@ -205,6 +208,9 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace)
            } else {
               tid = NULL;
            }
+           if (is_bopen(bfd)) {
+               Jmsg1(jcr, M_ERROR, 0, "bpkt already open fid=%d\n", bfd->fid);
+           }
            if ((bopen(bfd, attr->ofname, mode, 0)) < 0) {
                Jmsg2(jcr, M_ERROR, 0, _("Could not open %s: ERR=%s\n"), 
                     attr->ofname, berror(bfd));
@@ -234,7 +240,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace)
            return CF_ERROR;
         }
         return CF_CREATED;
-
+#endif
       } /* End inner switch */
 
    case FT_DIR:
@@ -248,6 +254,9 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace)
        *   and saved.
        */
       if (!is_portable_backup(bfd)) {
+        if (is_bopen(bfd)) {
+            Jmsg1(jcr, M_ERROR, 0, "bpkt already open fid=%d\n", bfd->fid);
+        }
         if ((bopen(bfd, attr->ofname, O_WRONLY|O_BINARY, 0)) < 0) {
             Jmsg2(jcr, M_ERROR, 0, _("Could not open %s: ERR=%s\n"), 
                  attr->ofname, berror(bfd));