summaryrefslogtreecommitdiff
path: root/internal/file/file.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-21 12:28:12 +0200
committerPaul Buetow <paul@buetow.org>2026-02-21 12:28:12 +0200
commit480162734c196b4b966a7f5a1c5df3749cd129c6 (patch)
tree31406644a6625a5d38d309d9219682c65e22fbb3 /internal/file/file.go
parent776910425e216bd2db9fbd78bfea8508ba7076c4 (diff)
Handle unknown flags for openat2
Amp-Thread-ID: https://ampcode.com/threads/T-019c7faf-baaa-704f-af15-8aeba9df4628 Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'internal/file/file.go')
-rw-r--r--internal/file/file.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/internal/file/file.go b/internal/file/file.go
index 85894c9..ff8dae2 100644
--- a/internal/file/file.go
+++ b/internal/file/file.go
@@ -24,15 +24,15 @@ type FdFile struct {
}
func NewFd(fd int32, name string, flags int32) FdFile {
- f := FdFile{
- fd: fd,
- name: name,
- flags: Flags(flags),
- }
- if f.flags == -1 {
- panic(fmt.Sprintf("DEBUG with -1 flags: %v", f))
- }
- return f
+ f := FdFile{
+ fd: fd,
+ name: name,
+ flags: Flags(flags),
+ }
+ if f.flags == -1 {
+ f.flags = unknownFlag
+ }
+ return f
}
func NewFdWithPid(fd int32, pid uint32) (f FdFile) {