From ed18bbe9cb8ce3638ed11019c62369c5f93558d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Tue, 22 Jun 2004 08:34:46 +0000 Subject: [PATCH] Set up logging before trying to lock the sandbox; otherwise tbmaster(1) will just log a mysterious "tinderbox returned exit code 35". --- tools/tools/tinderbox/tinderbox.pl | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tools/tools/tinderbox/tinderbox.pl b/tools/tools/tinderbox/tinderbox.pl index 96214c84ad5e..686e325bedf4 100644 --- a/tools/tools/tinderbox/tinderbox.pl +++ b/tools/tools/tinderbox/tinderbox.pl @@ -378,21 +378,6 @@ MAIN:{ $cmds{$cmd} = 1; } - # Take control of our sandbox - if ($sandbox !~ m|^(/[\w./-]+)$|) { - error("invalid sandbox directory"); - } - $sandbox = "$1/$branch/$arch/$machine"; - $ENV{'HOME'} = $sandbox; - make_dir($sandbox) - or error("$sandbox: $!"); - my $lockfile = open_locked("$sandbox/lock", O_RDWR|O_CREAT); - if (!defined($lockfile)) { - error("unable to lock sandbox"); - } - truncate($lockfile, 0); - print($lockfile "$$\n"); - # Open logfile open(STDIN, '<', "/dev/null") or error("/dev/null: $!\n"); @@ -412,6 +397,21 @@ MAIN:{ $SIG{__DIE__} = \&sigdie; $SIG{__WARN__} = \&sigwarn; + # Take control of our sandbox + if ($sandbox !~ m|^(/[\w./-]+)$|) { + error("invalid sandbox directory"); + } + $sandbox = "$1/$branch/$arch/$machine"; + $ENV{'HOME'} = $sandbox; + make_dir($sandbox) + or error("$sandbox: $!"); + my $lockfile = open_locked("$sandbox/lock", O_RDWR|O_CREAT); + if (!defined($lockfile)) { + error("unable to lock sandbox"); + } + truncate($lockfile, 0); + print($lockfile "$$\n"); + # Clean up remains from old runs if ($cmds{'clean'}) { logstage("cleaning the sandbox");