afs.c: Fix open_afs_tables().
[paraslash.git] / afs.c
diff --git a/afs.c b/afs.c
index c410854..d889ec7 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -684,12 +684,12 @@ static int open_afs_tables(void)
                        continue;
                PARA_ERROR_LOG("%s init: %s\n", afs_tables[i].name,
                        PARA_STRERROR(-ret));
+               break;
        }
        if (ret >= 0)
                return ret;
-       do
-               afs_tables[i].close();
-       while (i--);
+       while (i)
+               afs_tables[--i].close();
        return ret;
 }