diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2020-09-29 10:30:45 +0100 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2020-09-29 10:32:02 +0100 |
commit | 3d351b98c24e617b13f120605dd8d6c9c7892e4e (patch) | |
tree | 2ffa3f56b552dd5df71b2e361b6c8fcdc20b2d05 /src/lib/efreet | |
parent | 85a0af8281ffd8fd28f0e96657da6e0550225ca8 (diff) |
efreet - windows - still call stat but skip lstat/readlink
now stat is filled with data on windows
@fix
Diffstat (limited to 'src/lib/efreet')
-rw-r--r-- | src/lib/efreet/efreet_cache.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/efreet/efreet_cache.c b/src/lib/efreet/efreet_cache.c index a8eb425b6a..a801081ce9 100644 --- a/src/lib/efreet/efreet_cache.c +++ b/src/lib/efreet/efreet_cache.c | |||
@@ -627,22 +627,24 @@ EAPI Eina_Bool | |||
627 | efreet_file_cache_fill(const char *file, Efreet_Cache_Check *check) | 627 | efreet_file_cache_fill(const char *file, Efreet_Cache_Check *check) |
628 | { | 628 | { |
629 | struct stat st; | 629 | struct stat st; |
630 | ssize_t size = 0; | ||
631 | char link[PATH_MAX]; | ||
632 | 630 | ||
633 | memset(check, 0, sizeof(Efreet_Cache_Check)); | 631 | memset(check, 0, sizeof(Efreet_Cache_Check)); |
634 | #ifndef _WIN32 | 632 | #ifdef _WIN32 |
633 | if (stat(file, &st) != 0) return EINA_FALSE; | ||
634 | #else | ||
635 | ssize_t size = 0; | ||
636 | |||
635 | if (lstat(file, &st) != 0) return EINA_FALSE; | 637 | if (lstat(file, &st) != 0) return EINA_FALSE; |
636 | if (S_ISLNK(st.st_mode)) | 638 | if (S_ISLNK(st.st_mode)) |
637 | { | 639 | { |
640 | char link[PATH_MAX]; | ||
641 | |||
638 | size = readlink(file, link, sizeof(link)); | 642 | size = readlink(file, link, sizeof(link)); |
639 | if ((size > 0) && ((size_t)size >= sizeof(link))) return EINA_FALSE; | 643 | if ((size > 0) && ((size_t)size >= sizeof(link))) return EINA_FALSE; |
640 | if (stat(file, &st) != 0) return EINA_FALSE; | 644 | if (stat(file, &st) != 0) return EINA_FALSE; |
641 | } | 645 | } |
642 | if (size > 0) sha1((unsigned char *)link, size, check->link_sha1); | 646 | if (size > 0) sha1((unsigned char *)link, size, check->link_sha1); |
643 | else | ||
644 | #endif | 647 | #endif |
645 | memset(check->link_sha1, 0, sizeof(check->link_sha1)); | ||
646 | check->uid = st.st_uid; | 648 | check->uid = st.st_uid; |
647 | check->gid = st.st_gid; | 649 | check->gid = st.st_gid; |
648 | check->size = st.st_size; | 650 | check->size = st.st_size; |