File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,11 @@ package main
8
8
9
9
import (
10
10
"bufio"
11
+ "bytes"
11
12
"fmt"
12
13
"os"
13
14
"os/exec"
14
15
"regexp"
15
- "slices"
16
16
"sort"
17
17
"strconv"
18
18
"strings"
@@ -127,16 +127,17 @@ func main() {
127
127
os .Exit (1 )
128
128
}
129
129
130
- if slices .Contains ([]string {"riscv64" , "loong64" , "arm64" }, goarch ) {
131
- // Kernel linux v6.11 removed some __NR_* constants that only
130
+ switch goarch {
131
+ case "riscv64" , "loong64" , "arm64" :
132
+ // Kernel linux v6.11 removed some __NR_* macros that only
132
133
// existed on some architectures as an implementation detail. In
133
134
// order to keep backwards compatibility we add them back.
134
135
//
135
- // See https://lkml.org/lkml/2024/8/5/1283
136
- if ! strings .Contains (string ( cmd ), "#define __NR_arch_specific_syscall" ) {
136
+ // See https://lkml.org/lkml/2024/8/5/1283.
137
+ if ! bytes .Contains (cmd , [] byte ( "#define __NR_arch_specific_syscall" ) ) {
137
138
cmd = append (cmd , []byte ("#define __NR_arch_specific_syscall 244\n " )... )
138
139
}
139
- if ! strings .Contains (string ( cmd ), "#define __NR_fstatat" ) {
140
+ if ! bytes .Contains (cmd , [] byte ( "#define __NR_fstatat" ) ) {
140
141
cmd = append (cmd , []byte ("#define __NR_fstatat 79\n " )... )
141
142
}
142
143
}
You can’t perform that action at this time.
0 commit comments