@displays = map { s/ //g; $_ } @displays;
# No displays specified, let’s start some Xdummy instances.
-if (@displays == 0) {
- my ($displays, $pids) = start_xdummy($parallel);
- @displays = @$displays;
+@displays = start_xdummy($parallel) if @displays == 0;
- push our @CLEANUP, sub { kill(15, $_) for @$pids };
-}
# connect to all displays for two reasons:
# 1: check if the display actually works
exec './Xdummy', ":$displaynum", '-config', '/dev/null';
exit 1;
}
- push(@childpids, $pid);
+ push(@main::CLEANUP, sub { kill(15, $pid) });
push(@displays, ":$displaynum");
push(@sockets_waiting, $x_socketpath . $displaynum);
$displaynum++;
sleep 0.1;
}
- return \@displays, \@childpids;
+ return @displays;
}
1