commit e4b9a50c4562bd5527f8a0a3c8c754c2c95031ca from: Stefan Sperling date: Sat Jul 27 21:49:12 2019 UTC read_meta_file() can fstat() instead of lstat() since file is already open commit - 107f9ed516be69c1b0d914887afb558e90a1ab4f commit + e4b9a50c4562bd5527f8a0a3c8c754c2c95031ca blob - cbb8b461c91f58ff1ed7e56ea8b4439f80722191 blob + d13a217315b4bc76901ed6b4828f4641abb540b2 --- lib/worktree.c +++ lib/worktree.c @@ -142,8 +142,8 @@ read_meta_file(char **content, const char *path_got, c goto done; } - if (lstat(path, &sb) != 0) { - err = got_error_from_errno2("lstat", path); + if (fstat(fd, &sb) != 0) { + err = got_error_from_errno2("fstat", path); goto done; } *content = calloc(1, sb.st_size);