OSDN Git Service

Remove unused field of struct iterator.
[android-x86/external-exfat.git] / libexfat / node.c
index 6a93277..a5491b1 100644 (file)
@@ -3,7 +3,7 @@
        exFAT file system implementation library.
 
        Free exFAT implementation.
-       Copyright (C) 2010-2015  Andrew Nayenko
+       Copyright (C) 2010-2016  Andrew Nayenko
 
        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
@@ -30,7 +30,6 @@ struct iterator
 {
        cluster_t cluster;
        off_t offset;
-       int contiguous;
        char* chunk;
 };
 
@@ -99,7 +98,6 @@ static int opendir(struct exfat* ef, const struct exfat_node* dir,
                exfat_bug("not a directory");
        it->cluster = dir->start_cluster;
        it->offset = 0;
-       it->contiguous = IS_CONTIGUOUS(*dir);
        it->chunk = malloc(CLUSTER_SIZE(*ef->sb));
        if (it->chunk == NULL)
        {
@@ -109,6 +107,7 @@ static int opendir(struct exfat* ef, const struct exfat_node* dir,
        if (exfat_pread(ef->dev, it->chunk, CLUSTER_SIZE(*ef->sb),
                        exfat_c2o(ef, it->cluster)) < 0)
        {
+               free(it->chunk);
                exfat_error("failed to read directory cluster %#x", it->cluster);
                return -EIO;
        }
@@ -119,7 +118,6 @@ static void closedir(struct iterator* it)
 {
        it->cluster = 0;
        it->offset = 0;
-       it->contiguous = 0;
        free(it->chunk);
        it->chunk = NULL;
 }