mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
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>
This commit is contained in:
parent
2f042c93a1
commit
6efb745828
@ -142,10 +142,10 @@ if (!is_supported_architecture()) {
|
|||||||
foreach(@SUPPORTED_ARCHITECTURES) {
|
foreach(@SUPPORTED_ARCHITECTURES) {
|
||||||
printf "\t%s\n", $_;
|
printf "\t%s\n", $_;
|
||||||
}
|
}
|
||||||
|
printf("\n");
|
||||||
|
|
||||||
my $archname = $Config{archname};
|
my $archname = `uname -m`;
|
||||||
printf "\n\$ perl -MConfig -e \'print \"\$Config{archname}\\n\"\'\n";
|
printf("Machine hardware name (`uname -m`): %s\n", $archname);
|
||||||
printf "%s\n", $archname;
|
|
||||||
|
|
||||||
exit(129);
|
exit(129);
|
||||||
}
|
}
|
||||||
@ -172,7 +172,7 @@ sub is_supported_architecture
|
|||||||
|
|
||||||
sub is_x86_64
|
sub is_x86_64
|
||||||
{
|
{
|
||||||
my $archname = $Config{archname};
|
my $archname = `uname -m`;
|
||||||
|
|
||||||
if ($archname =~ m/x86_64/) {
|
if ($archname =~ m/x86_64/) {
|
||||||
return 1;
|
return 1;
|
||||||
@ -182,9 +182,9 @@ sub is_x86_64
|
|||||||
|
|
||||||
sub is_ppc64
|
sub is_ppc64
|
||||||
{
|
{
|
||||||
my $archname = $Config{archname};
|
my $archname = `uname -m`;
|
||||||
|
|
||||||
if ($archname =~ m/powerpc/ and $archname =~ m/64/) {
|
if ($archname =~ m/ppc64/) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user