1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-25 20:25:28 +03:00
aports/testing/termshark/no-dup2.patch
Sören Tempel db159f0f93 testing/termshark: fix build on riscv64
* Requires newer version of the pty module.
* Use dup3 instead of dup2.

See https://github.com/gcla/termshark/issues/127
2021-07-10 14:00:45 +02:00

15 lines
748 B
Diff

The dup2 syscalls is not available on riscv64. However, using dup3 with
zero as a flags argument is equivalent.
diff -upr termshark-2.2.0.orig/system/dumpcapext.go termshark-2.2.0/system/dumpcapext.go
--- termshark-2.2.0.orig/system/dumpcapext.go 2021-07-10 16:53:56.607649135 +0200
+++ termshark-2.2.0/system/dumpcapext.go 2021-07-10 16:55:47.034414600 +0200
@@ -47,7 +47,7 @@ func DumpcapExt(dumpcapBin string, tshar
if err != nil {
log.Warnf("Unexpected error parsing %s: %v", args[1], err)
} else {
- err = syscall.Dup2(fd, 0)
+ err = syscall.Dup3(fd, 0, 0)
if err != nil {
log.Warnf("Problem duplicating fd %d to 0: %v", fd, err)
log.Warnf("Will not try to replace argument %s to tshark", args[1])