mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-22 14:07:55 +00:00
parallel: exec sleep does not work on CygWin.
This commit is contained in:
parent
dd25255ca8
commit
e06ab693b3
13
src/parallel
13
src/parallel
|
@ -1376,7 +1376,7 @@ sub check_invalid_option_combinations {
|
||||||
|
|
||||||
sub init_globals {
|
sub init_globals {
|
||||||
# Defaults:
|
# Defaults:
|
||||||
$Global::version = 20170515;
|
$Global::version = 20170522;
|
||||||
$Global::progname = 'parallel';
|
$Global::progname = 'parallel';
|
||||||
$Global::infinity = 2**31;
|
$Global::infinity = 2**31;
|
||||||
$Global::debug = 0;
|
$Global::debug = 0;
|
||||||
|
@ -5513,9 +5513,14 @@ sub compute_number_of_processes {
|
||||||
# The child takes one process slot
|
# The child takes one process slot
|
||||||
# It will be killed later
|
# It will be killed later
|
||||||
$SIG{'TERM'} = $Global::original_sig{'TERM'};
|
$SIG{'TERM'} = $Global::original_sig{'TERM'};
|
||||||
# 'exec sleep' takes less RAM than sleeping in perl
|
if($^O eq "cygwin") {
|
||||||
exec 'sleep', 10101;
|
# The exec does not work on Cygwin
|
||||||
exit(0);
|
sleep 10101010;
|
||||||
|
} else {
|
||||||
|
# 'exec sleep' takes less RAM than sleeping in perl
|
||||||
|
exec 'sleep', 10101;
|
||||||
|
}
|
||||||
|
exit(0);
|
||||||
} else {
|
} else {
|
||||||
# Failed to spawn
|
# Failed to spawn
|
||||||
$max_system_proc_reached = 1;
|
$max_system_proc_reached = 1;
|
||||||
|
|
Loading…
Reference in a new issue