]> git.sur5r.net Git - bacula/bacula/commitdiff
bugfix: an early cancel (e.g. during request for label) causes a "goto cleanup"
authorThorsten Engel <thorsten.engel@matrix-computer.com>
Fri, 21 Apr 2006 16:04:16 +0000 (16:04 +0000)
committerThorsten Engel <thorsten.engel@matrix-computer.com>
Fri, 21 Apr 2006 16:04:16 +0000 (16:04 +0000)
which leads to a runtime error when the vss_mutex was released, but never
locked.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2954 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/filed/job.c

index ac389dc45dde022d5594e4ef1cbdc6df5c3fb3ae..6c2185702951e98bff5be889be21dde8af0abeaa 100644 (file)
@@ -1190,6 +1190,12 @@ static int backup_cmd(JCR *jcr)
    int SDJobStatus;
    char ed1[50], ed2[50];
 
+#ifdef WIN32_VSS
+   if (g_pVSSClient && enable_vss)
+      /* Run only one at a time */
+      P(vss_mutex);
+#endif
+
    set_jcr_job_status(jcr, JS_Blocked);
    jcr->JobType = JT_BACKUP;
    Dmsg1(100, "begin backup ff=%p\n", jcr->ff);
@@ -1240,9 +1246,7 @@ static int backup_cmd(JCR *jcr)
 
 #ifdef WIN32_VSS
    /* START VSS ON WIN 32 */
-   if (g_pVSSClient && enable_vss) {
-      /* Run only one at a time */
-      P(vss_mutex);
+   if (g_pVSSClient && enable_vss) {      
       if (g_pVSSClient->InitializeForBackup()) {   
         /* tell vss which drives to snapshot */   
         char szWinDriveLetters[27];