]> git.tue.mpg.de Git - paraslash.git/commitdiff
afs.c: Fix open_afs_tables().
authorAndre Noll <maan@systemlinux.org>
Wed, 24 Oct 2007 10:49:16 +0000 (12:49 +0200)
committerAndre Noll <maan@systemlinux.org>
Wed, 24 Oct 2007 10:49:16 +0000 (12:49 +0200)
The old code tried to close the table we just failed to open.
We just want to close all tables that were opened successfully
before the failed one.

afs.c

diff --git a/afs.c b/afs.c
index c410854c1129a91a811d21101886276aae731a2e..d889ec771c9cc0d5c10860621528752faa778888 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;
 }