Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

Commit e24d3b2

Browse files
committed
Look for ifconfig.sh.in in testsock.pl parent dir
Instead of using the current working directory to find the ifconfig.sh script, look for the ifconfig.sh.in template in the directory where the testsock.pl script is located. This enables the testsock.pl script to be called from any working directory. Using the ifconfig.sh.in template is sufficient, since it contains the necessary information to be extracted: the max= value (which is hard-coded in the template).
1 parent d9a9720 commit e24d3b2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bin/tests/system/testsock.pl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
require 5.001;
1717

18+
use Cwd 'abs_path';
19+
use File::Basename;
1820
use Socket;
1921
use Getopt::Long;
2022

@@ -27,7 +29,8 @@
2729
if ($id != 0) {
2830
@ids = ($id);
2931
} else {
30-
my $fn = "ifconfig.sh";
32+
my $dir = dirname(abs_path($0));
33+
my $fn = "$dir/ifconfig.sh.in";
3134
open FH, "< $fn" or die "open < $fn: $!\n";
3235
while (<FH>) {
3336
@ids = (1..$1)

0 commit comments

Comments
 (0)