sem: Problem if ~/.parallel does not exist. Fixed.

This commit is contained in:
Ole Tange 2010-12-22 10:21:58 +01:00
parent ef812dd02a
commit 39526ff1fe
2 changed files with 5 additions and 1 deletions

View file

@ -1,3 +1,5 @@
Testsuite: sem without ~/.parallel
cleanup of transferred files in workdir fixed.
-T implemented as ssh/rsync sometimes hang due to getting a tty.

View file

@ -3465,7 +3465,9 @@ sub new {
my $count = shift;
$id=~s/([^-_a-z0-9])/unpack("H*",$1)/ige; # Convert non-word chars to hex
$id="id-".$id; # To distinguish it from a process id
my $parallel_locks = $ENV{'HOME'}."/.parallel/semaphores";
my $parallel_dir = $ENV{'HOME'}."/.parallel";
-d $parallel_dir or mkdir $parallel_dir;
my $parallel_locks = $parallel_dir."/semaphores";
-d $parallel_locks or mkdir $parallel_locks;
my $lockdir = "$parallel_locks/$id";
my $lockfile = $lockdir.".lock";