blink: The linux kernel has a race condition for blinking drives. -j1 works around it.
This commit is contained in:
parent
172e7972f5
commit
a51c490af0
12
blink/blink
12
blink/blink
|
@ -185,21 +185,21 @@ if($::opt_on) {
|
||||||
|
|
||||||
sub on {
|
sub on {
|
||||||
my $locate = shift;
|
my $locate = shift;
|
||||||
print("parallel echo 1 \\> ::: $locate\n");
|
print("parallel -j1 echo 1 \\> ::: $locate\n");
|
||||||
system("parallel echo 1 \\> ::: $locate\n");
|
system("parallel -j1 echo 1 \\> ::: $locate\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub off {
|
sub off {
|
||||||
my $locate = shift;
|
my $locate = shift;
|
||||||
print("parallel echo 0 \\> ::: $locate\n");
|
print("parallel -j1 echo 0 \\> ::: $locate\n");
|
||||||
system("parallel echo 0 \\> ::: $locate\n");
|
system("parallel -j1 echo 0 \\> ::: $locate\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub toggle {
|
sub toggle {
|
||||||
my $locate = shift;
|
my $locate = shift;
|
||||||
# If the file 'locate' contains 1 it should be put to 0.
|
# If the file 'locate' contains 1 it should be put to 0.
|
||||||
print('parallel grep -q 1 {} \; echo \$? \\> {} :::'." $locate\n");
|
print('parallel -j1 grep -q 1 {} \; echo \$? \\> {} :::'." $locate\n");
|
||||||
system('parallel grep -q 1 {} \; echo \$? \\> {} :::'." $locate\n");
|
system('parallel -j1 grep -q 1 {} \; echo \$? \\> {} :::'." $locate\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue