summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeonah Moon <seonah1.moon@samsung.com>2016-03-07 20:06:32 +0900
committerSeonah Moon <seonah1.moon@samsung.com>2016-03-07 20:06:44 +0900
commit03112ff2183888462b9b0715e0e39d8d2abed7f3 (patch)
tree84fd61aaa01dcc1f57db5879df8da31278308fe5
parentd42162ed9c96aa00dcd320f569b780b0352d78bb (diff)
downloadlibsoup-03112ff2183888462b9b0715e0e39d8d2abed7f3.tar.gz
libsoup-03112ff2183888462b9b0715e0e39d8d2abed7f3.tar.bz2
libsoup-03112ff2183888462b9b0715e0e39d8d2abed7f3.zip
Change-Id: I2ae498015b91794d3900625b7165971e4815a07b Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
-rwxr-xr-xlibsoup/soup-cache.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libsoup/soup-cache.c b/libsoup/soup-cache.c
index 3d033758..bd09b162 100755
--- a/libsoup/soup-cache.c
+++ b/libsoup/soup-cache.c
@@ -1451,7 +1451,11 @@ soup_cache_foreach_regular_file (SoupCache *cache, SoupCacheForeachFileFunc func
dir = opendir(priv->cache_dir);
if (dir) {
struct dirent *dp;
- while ((dp = readdir(dir)) != NULL) {
+ struct dirent dent_buf;
+ while (!readdir_r(dir, &dent_buf, &dp) && dp) {
+ if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, ".."))
+ continue;
+
name = dp->d_name;
if (g_str_has_prefix (name, "soup."))
continue;