Skip to contentSkip to conversation

Change dev->bcache_fd default value from 0 to -1

PATCH New Zhao Heming 1 participant 1 message May 31, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Change dev->bcache_fd default value from 0 to -1

This fix can avoid bcache_fd will mistakenly open/close in later.

---
 lib/device/dev-cache.c | 1 +
 1 file changed, 1 insertion(+)
lib/device/dev-cache.c +1 -0
index 6af559c..c3f7c49 100644
@@ -65,6 +65,7 @@ static int _insert(const char *path, const struct stat *info,
 static void _dev_init(struct device *dev)
 {
 	dev->fd = -1;
+	dev->bcache_fd = -1;
 	dev->read_ahead = -1;
 
 	dev->ext.enabled = 0;
Signature · 1 line
1.8.3.1