X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=libexfat%2Fmount.c;h=86fb84db2445f56615f965579e3cd69b04d536d7;hb=refs%2Ftags%2Fupstream%2F1.4.0;hp=f0ca0e3dd635f6d5b2bf5438463b36b68bb25a8b;hpb=1e7534bbaa34e6c2a8c9809dfcf6588112cbdee4;p=sven%2Ffuse-exfat.git

diff --git a/libexfat/mount.c b/libexfat/mount.c
index f0ca0e3..86fb84d 100644
--- a/libexfat/mount.c
+++ b/libexfat/mount.c
@@ -3,7 +3,7 @@
 	exFAT file system implementation library.
 
 	Free exFAT implementation.
-	Copyright (C) 2010-2018  Andrew Nayenko
+	Copyright (C) 2010-2023  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
@@ -198,7 +198,7 @@ int exfat_mount(struct exfat* ef, const char* spec, const char* options)
 		mode = EXFAT_MODE_RW;
 	ef->dev = exfat_open(spec, mode);
 	if (ef->dev == NULL)
-		return -EIO;
+		return -ENODEV;
 	if (exfat_get_mode(ef->dev) == EXFAT_MODE_RO)
 	{
 		if (mode == EXFAT_MODE_ANY)
@@ -305,7 +305,7 @@ int exfat_mount(struct exfat* ef, const char* spec, const char* options)
 	ef->root->start_cluster = le32_to_cpu(ef->sb->rootdir_cluster);
 	ef->root->fptr_cluster = ef->root->start_cluster;
 	ef->root->name[0] = cpu_to_le16('\0');
-	ef->root->size = rootdir_size(ef);
+	ef->root->valid_size = ef->root->size = rootdir_size(ef);
 	if (ef->root->size == 0)
 	{
 		exfat_free(ef);