]> go.fuhry.dev Git - runtime.git/commitdiff
fsnotify: use os.Getwd instead of syscall.Getcwd
authorDan Fuhry <dan@fuhry.com>
Thu, 13 Nov 2025 23:53:48 +0000 (18:53 -0500)
committerDan Fuhry <dan@fuhry.com>
Thu, 13 Nov 2025 23:53:48 +0000 (18:53 -0500)
mtls/fsnotify/util.go

index caf07cce44812aa4bf3030aecb92cdd215393ea4..78bbd819909d2f0009917a18ad6d3978b9614c2e 100644 (file)
@@ -45,12 +45,11 @@ func isSymlink(fullPath string) bool {
 
 // getcwd returns the current working directory.
 func getcwd() string {
-       buf := make([]byte, 1024)
-       n, err := syscall.Getcwd(buf)
+       wd, err := os.Getwd()
        if err != nil {
                panic("could not get cwd")
        }
-       return string(buf[:n-1])
+       return wd
 }
 
 // realpath removes "." components and replaces ".." components in an absolute or relative path,