Skip to content

Commit 2cd05e4

Browse files
committed
libct/seccomp/patchbpf: rm duplicated code
In findLastSyscalls, we convert libseccomp.ArchNative to the real libseccomp architecture, but archToNative already does that, so this code is redundant. Remove the redundant code, and move its comment to archToNative. Fixes: 7a8d716 Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent c393d16 commit 2cd05e4

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

libcontainer/seccomp/patchbpf/enosys_linux.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -240,16 +240,6 @@ func findLastSyscalls(config *configs.Seccomp) (lastSyscallMap, error) {
240240
return nil, fmt.Errorf("unable to validate seccomp architecture: %w", err)
241241
}
242242

243-
// Map native architecture to a real architecture value to avoid
244-
// doubling-up the lastSyscall mapping.
245-
if arch == libseccomp.ArchNative {
246-
nativeArch, err := libseccomp.GetNativeArch()
247-
if err != nil {
248-
return nil, fmt.Errorf("unable to get native architecture: %w", err)
249-
}
250-
arch = nativeArch
251-
}
252-
253243
// Figure out native architecture representation of the architecture.
254244
nativeArch, err := archToNative(arch)
255245
if err != nil {

0 commit comments

Comments
 (0)