From 18cde7f79954357c986a257a0896f339a75fa1c1 Mon Sep 17 00:00:00 2001 From: Marcel Hetzendorfer Date: Fri, 3 May 2024 20:34:10 +0200 Subject: [PATCH] o_NOBLOCK on file open --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 7f1f62e..57f19ed 100644 --- a/main.go +++ b/main.go @@ -119,7 +119,7 @@ func work(p string) error { decrementCurrentlyWorkingWorkers() }() - f, err := os.OpenFile(p, os.O_RDONLY|syscall.O_NOFOLLOW, 0) + f, err := os.OpenFile(p, os.O_RDONLY|syscall.O_NOFOLLOW|syscall.O_NONBLOCK, 0) if err != nil { if errors.Is(err, syscall.ELOOP) { return nil // this is O_NOFOLLOW result, we tried to open a symlink, ignore