mirror of
https://github.com/schoebel/mars
synced 2024-12-12 18:01:21 +00:00
marsadm: fix lamport warning when mars.ko is not loaded
This commit is contained in:
parent
059abe866b
commit
ab1723f306
@ -179,12 +179,13 @@ sub get_alive_links {
|
||||
# fallback to system time()
|
||||
#
|
||||
sub mars_time {
|
||||
open(my $lamport_clock, "<", "/proc/sys/mars/lamport_clock");
|
||||
my $lamport_time;
|
||||
while (<$lamport_clock>) {
|
||||
$lamport_time = $1 if /^lamport_now=(.*)/;
|
||||
if (open(my $lamport_clock, "<", "/proc/sys/mars/lamport_clock")) {
|
||||
while (<$lamport_clock>) {
|
||||
$lamport_time = $1 if /^lamport_now=(.*)/;
|
||||
}
|
||||
close($lamport_clock);
|
||||
}
|
||||
close($lamport_clock);
|
||||
return $lamport_time || time() . "." . '0' x 9;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user