Commit ea73047f by Celine Mercier

Added rewinddir before each readdir so that the directories are always

read properly
parent 09982689
......@@ -562,6 +562,7 @@ static bool view_exists(OBIDMS_p dms, const char* view_name)
if (file_name == NULL)
return -1;
rewinddir(dms->view_directory);
while ((dp = readdir(dms->view_directory)) != NULL)
{
if ((dp->d_name)[0] == '.')
......@@ -581,6 +582,7 @@ static bool view_exists(OBIDMS_p dms, const char* view_name)
if (file_name == NULL)
return -1;
rewinddir(dms->view_directory);
while ((dp = readdir(dms->view_directory)) != NULL)
{
if ((dp->d_name)[0] == '.')
......@@ -2537,6 +2539,7 @@ int obi_clean_unfinished_views(OBIDMS_p dms)
d = 0;
// Look for unfinished views and delete them
rewinddir(dms->view_directory);
while ((dp = readdir(dms->view_directory)) != NULL)
{
if ((dp->d_name)[0] == '.')
......@@ -2754,6 +2757,7 @@ int obi_rollback_view(Obiview_p view)
{
strcpy(view_file_name, (view->infos)->name);
strcat(view_file_name, ".obiview_unfinished");
rewinddir((view->dms)->view_directory);
while ((dp = readdir((view->dms)->view_directory)) != NULL)
{
if ((dp->d_name)[0] == '.')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment