git.samba.org
/
metze
/
samba
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8556602
)
selftest: correct the import of Time::HighRes
author
Matthieu Patou
<mat@matws.net>
Mon, 18 Oct 2010 16:21:12 +0000
(20:21 +0400)
committer
Matthieu Patou
<mat@samba.org>
Mon, 18 Oct 2010 19:09:07 +0000
(19:09 +0000)
The "use" is always evaluated first even if enclosed into a if. So
on plateform without Time::Hires (ie. sun8 in the build farm). This
leads to an error.
Instead we use the synthax require Module + Module->import("function")
selftest/selftest.pl
patch
|
blob
|
history
diff --git
a/selftest/selftest.pl
b/selftest/selftest.pl
index 08ee52c55ed0f57d3cdfae90198cb722f3a96856..7431bed8ed8ad3eda71ef7f6df53c55ee8d7abf2 100755
(executable)
--- a/
selftest/selftest.pl
+++ b/
selftest/selftest.pl
@@
-135,9
+135,10
@@
use SocketWrapper;
eval {
require Time::HiRes;
+Time::HiRes->import("time");
};
-
unless
($@) {
-
use Time::HiRes qw(time)
;
+
if
($@) {
+
print "You don't have Time::Hires installed !\n"
;
}
my $opt_help = 0;