OSDN Git Service

Simplified return code checking in shrink_directory().
authorresver@gmail.com <resver@gmail.com@60bc1c72-a15a-11de-b98f-4500b42dc123>
Sun, 10 Nov 2013 15:15:19 +0000 (15:15 +0000)
committerresver@gmail.com <resver@gmail.com@60bc1c72-a15a-11de-b98f-4500b42dc123>
Sun, 10 Nov 2013 15:15:19 +0000 (15:15 +0000)
git-svn-id: http://exfat.googlecode.com/svn/trunk@385 60bc1c72-a15a-11de-b98f-4500b42dc123

libexfat/node.c

index 3d27ad5..3bf72f0 100644 (file)
@@ -673,7 +673,6 @@ static int shrink_directory(struct exfat* ef, struct exfat_node* dir,
        const struct exfat_node* last_node;
        uint64_t entries = 0;
        uint64_t new_size;
-       int rc;
 
        if (!(dir->flags & EXFAT_ATTRIB_DIR))
                exfat_bug("attempted to shrink a file");
@@ -709,10 +708,7 @@ static int shrink_directory(struct exfat* ef, struct exfat_node* dir,
                new_size = CLUSTER_SIZE(*ef->sb);
        if (new_size == dir->size)
                return 0;
-       rc = exfat_truncate(ef, dir, new_size, true);
-       if (rc != 0)
-               return rc;
-       return 0;
+       return exfat_truncate(ef, dir, new_size, true);
 }
 
 static int delete(struct exfat* ef, struct exfat_node* node)