From a959f3989ca49384360c855776263d8c85a36ae8 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 29 Sep 2020 10:30:45 +0100 Subject: [PATCH] efreet - windows - still call stat but skip lstat/readlink now stat is filled with data on windows @fix --- src/lib/efreet/efreet_cache.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/lib/efreet/efreet_cache.c b/src/lib/efreet/efreet_cache.c index ff621a2..025cc12 100644 --- a/src/lib/efreet/efreet_cache.c +++ b/src/lib/efreet/efreet_cache.c @@ -630,22 +630,24 @@ EAPI Eina_Bool efreet_file_cache_fill(const char *file, Efreet_Cache_Check *check) { struct stat st; - ssize_t size = 0; - char link[PATH_MAX]; memset(check, 0, sizeof(Efreet_Cache_Check)); -#ifndef _WIN32 +#ifdef _WIN32 + if (stat(file, &st) != 0) return EINA_FALSE; +#else + ssize_t size = 0; + if (lstat(file, &st) != 0) return EINA_FALSE; if (S_ISLNK(st.st_mode)) { + char link[PATH_MAX]; + size = readlink(file, link, sizeof(link)); if ((size > 0) && ((size_t)size >= sizeof(link))) return EINA_FALSE; if (stat(file, &st) != 0) return EINA_FALSE; } if (size > 0) sha1((unsigned char *)link, size, check->link_sha1); - else #endif - memset(check->link_sha1, 0, sizeof(check->link_sha1)); check->uid = st.st_uid; check->gid = st.st_gid; check->size = st.st_size; -- 2.7.4