"err" is deleted because it just causes confusion when "errno" is also
used directly in process_lstat_error().

Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com>
---
 builtin/update-index.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/builtin/update-index.c b/builtin/update-index.c
index 1c94ca5..0c539ed 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -251,11 +251,11 @@ static int remove_one_path(const char *path)
  *    succeeds.
  *  - permission error. That's never ok.
  */
-static int process_lstat_error(const char *path, int err)
+static int process_lstat_error(const char *path)
 {
-       if (err == ENOENT || err == ENOTDIR)
+       if (errno == ENOENT || errno == ENOTDIR)
                return remove_one_path(path);
-       return error("lstat(\"%s\"): %s", path, strerror(errno));
+       return error_errno("lstat(\"%s\")", path);
 }
 
 static int add_one_path(const struct cache_entry *old, const char *path, int 
len, struct stat *st)
@@ -382,7 +382,7 @@ static int process_path(const char *path)
         * what to do about the pathname!
         */
        if (lstat(path, &st) < 0)
-               return process_lstat_error(path, errno);
+               return process_lstat_error(path);
 
        if (S_ISDIR(st.st_mode))
                return process_directory(path, len, &st);
-- 
2.8.0.rc0.210.gd302cd2

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to