report errors better in send_file
authorDobrica Pavlinusic <dpavlin@rsync1>
Tue, 29 Nov 2011 21:21:03 +0000 (22:21 +0100)
committerDobrica Pavlinusic <dpavlin@rsync1>
Tue, 29 Nov 2011 21:21:03 +0000 (22:21 +0100)
gearman/send_file.pl

index 68304e5..7652e39 100755 (executable)
@@ -34,6 +34,8 @@ $worker->register_function( send_file => sub {
        make_path $t_basedir unless -d $t_basedir;
        link $f_dir . $from => $t_dir . $to;
 
+       die "ERROR: $!" if $!;
+
        return "send_file $f_dir $from -> $t_dir $to";
 });
 
@@ -45,6 +47,7 @@ $worker->register_function( delete => sub {
        warn "# delete [$work]\n";
 
        my $dir = home_dir($1) if $work =~ s/~(\w+)//;
+       my $login = $1;
        my $full = $dir . $work;
 
        if ( -d $full ) {