From f77a8081050e879666ed2a730ee8530e9ed7ba0b Mon Sep 17 00:00:00 2001 From: zhanluxianshen Date: Fri, 8 Nov 2024 22:07:21 +0800 Subject: [PATCH] Fix fsnotify.Remove logic function. Signed-off-by: zhanluxianshen --- .../create-dev-char-symlinks/create-dev-char-symlinks.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/nvidia-ctk/system/create-dev-char-symlinks/create-dev-char-symlinks.go b/cmd/nvidia-ctk/system/create-dev-char-symlinks/create-dev-char-symlinks.go index 7d269b92..36794a61 100644 --- a/cmd/nvidia-ctk/system/create-dev-char-symlinks/create-dev-char-symlinks.go +++ b/cmd/nvidia-ctk/system/create-dev-char-symlinks/create-dev-char-symlinks.go @@ -187,11 +187,11 @@ create: if !strings.HasPrefix(deviceNode, "nvidia") { continue } - if event.Op&fsnotify.Create == fsnotify.Create { + if event.Has(fsnotify.Create) { m.logger.Infof("%s created, restarting.", event.Name) goto create } - if event.Op&fsnotify.Create == fsnotify.Remove { + if event.Has(fsnotify.Remove) { m.logger.Infof("%s removed. Ignoring", event.Name) }