Commit b15816dd9e35575606d011dad4a3dcac204340da

Stefan Sperling 2019-08-11T20:01:21

in got_fileindex_entry_update() don't hide errors other than ENOENT

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/lib/fileindex.c b/lib/fileindex.c
index 4a26baa..1f0d5de 100644
--- a/lib/fileindex.c
+++ b/lib/fileindex.c
@@ -72,7 +72,8 @@ got_fileindex_entry_update(struct got_fileindex_entry *ie,
 	struct stat sb;
 
 	if (lstat(ondisk_path, &sb) != 0) {
-		if ((ie->flags & GOT_FILEIDX_F_NO_FILE_ON_DISK) == 0)
+		if (!((ie->flags & GOT_FILEIDX_F_NO_FILE_ON_DISK) &&
+		    errno == ENOENT))
 			return got_error_from_errno2("lstat", ondisk_path);
 	} else {
 		if (sb.st_mode & S_IFDIR)