summaryrefslogtreecommitdiff
blob: 3dc8d7b86f6564c87831cc4ee08c572db4bc0630 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--- first-isofs/isofs.c.~1~	2006-06-18 19:05:53.000000000 -0700
+++ first-isofs/isofs.c	2006-06-18 19:06:08.000000000 -0700
@@ -101,6 +101,23 @@
 	return 0;
 }
 
+static void cd_fini(void)
+{
+	switch (prom_vers) {
+	case PROM_V0:
+		romvec->pv_v0devops.v0_devclose(fd);
+		break;
+
+	case PROM_V2:
+	case PROM_V3:
+		romvec->pv_v2devops.v2_dev_close(fd);
+		break;
+
+	case PROM_P1275:
+		p1275_cmd("close", 1, fd);
+		break;
+	};
+}
 
 static int cd_read_block(unsigned long long offset, int size, void *data)
 {
@@ -445,6 +462,8 @@
 	sinfo->conf_part = 1;
 	strcpy(sinfo->conf_file, silo_conf);
 
+	cd_fini();
+
 	prom_putchar(sinfo->id);
 
 	return dest;