summaryrefslogtreecommitdiffstats
path: root/scripts/leaking_addresses.pl
diff options
context:
space:
mode:
authorTobin C. Harding <me@tobin.cc>2018-01-05 17:24:49 -0500
committerTobin C. Harding <me@tobin.cc>2018-04-06 18:50:34 -0400
commit6efb7458280a8f5d4c1955324e9d8985e90a882b (patch)
treed73b113a0ac2fcb6da5c1bd2f831e336c7a93f0e /scripts/leaking_addresses.pl
parent2f042c93a138f87a2f85e80daa5dbab6bf138045 (diff)
leaking_addresses: use system command to get arch
Currently script uses Perl to get the machine architecture. This can be erroneous since Perl uses the architecture of the machine that Perl was compiled on not the architecture of the running machine. We should use the systems `uname` command instead. Use `uname -m` instead of Perl to get the machine architecture. Signed-off-by: Tobin C. Harding <me@tobin.cc>
Diffstat (limited to 'scripts/leaking_addresses.pl')
-rwxr-xr-xscripts/leaking_addresses.pl12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl
index 35d6dd9fdced..56894daf6368 100755
--- a/scripts/leaking_addresses.pl
+++ b/scripts/leaking_addresses.pl
@@ -142,10 +142,10 @@ if (!is_supported_architecture()) {
142 foreach(@SUPPORTED_ARCHITECTURES) { 142 foreach(@SUPPORTED_ARCHITECTURES) {
143 printf "\t%s\n", $_; 143 printf "\t%s\n", $_;
144 } 144 }
145 printf("\n");
145 146
146 my $archname = $Config{archname}; 147 my $archname = `uname -m`;
147 printf "\n\$ perl -MConfig -e \'print \"\$Config{archname}\\n\"\'\n"; 148 printf("Machine hardware name (`uname -m`): %s\n", $archname);
148 printf "%s\n", $archname;
149 149
150 exit(129); 150 exit(129);
151} 151}
@@ -172,7 +172,7 @@ sub is_supported_architecture
172 172
173sub is_x86_64 173sub is_x86_64
174{ 174{
175 my $archname = $Config{archname}; 175 my $archname = `uname -m`;
176 176
177 if ($archname =~ m/x86_64/) { 177 if ($archname =~ m/x86_64/) {
178 return 1; 178 return 1;
@@ -182,9 +182,9 @@ sub is_x86_64
182 182
183sub is_ppc64 183sub is_ppc64
184{ 184{
185 my $archname = $Config{archname}; 185 my $archname = `uname -m`;
186 186
187 if ($archname =~ m/powerpc/ and $archname =~ m/64/) { 187 if ($archname =~ m/ppc64/) {
188 return 1; 188 return 1;
189 } 189 }
190 return 0; 190 return 0;