Don't call exit() in thread.
authorHuang Hao <hao.h.huang@intel.com>
Wed, 26 Sep 2012 09:37:28 +0000 (17:37 +0800)
committerHuang Hao <hao.h.huang@intel.com>
Thu, 27 Sep 2012 03:36:47 +0000 (11:36 +0800)
depanneur

index 8ebb3c3aaf446a492744304b13d11e04bee4ceab..7be3f39aac772fb81d5ae739fcb01e33e5897c9d 100755 (executable)
--- a/depanneur
+++ b/depanneur
@@ -831,16 +831,20 @@ sub build_package {
         {
             lock($DETACHING);
             threads->detach() if ! threads->is_detached();
+            $dirty = 1;
+            @running = grep { $_ ne "$name"} @running;
+            push(@done, $name);
         }
         info("finished incremental building $name");
         info("building log can be found here: $scratch/.build.log");
-        exit(0);
-    } else {
-        push @args, "--root $scratch";
-        push @args, "--clean" if (-e "$scratch/not-ready");
-        push @args, $redirect;
+        $packages_built = 1;
+        return 0;
     }
 
+    push @args, "--root $scratch";
+    push @args, "--clean" if (-e "$scratch/not-ready");
+    push @args, $redirect;
+
     $cmd = join(" ", @args);
     debug($cmd);
     if (my_system ($cmd) == 0 ) {