Deleted Added
full compact
1/*
2 * The new sysinstall program.
3 *
4 * This is probably the last attempt in the `sysinstall' line, the next
5 * generation being slated to essentially a complete rewrite.
6 *
7 * $Id: dos.c,v 1.2 1995/05/27 23:39:28 phk Exp $
8 *
9 * Copyright (c) 1995
10 * Jordan Hubbard. All rights reserved.
11 * Copyright (c) 1995
12 * Gary J Palmer. All rights reserved.
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions

--- 48 unchanged lines hidden (view full) ---

64 struct msdosfs_args args;
65
66 if (DOSMounted)
67 return TRUE;
68
69 if (Mkdir("/dos", NULL))
70 return FALSE;
71
72 args.fspec = dev->devname;
73 args.uid = args.gid = 0;
74
75 if (mount(MOUNT_MSDOS, "/dos", MNT_RDONLY, (caddr_t)&args) == -1) {
76 msgConfirm("Error mounting %s on /dos: %s (%u)\n", dev, strerror(errno), errno);
77 return FALSE;
78 }
79 DOSMounted = TRUE;
80 return TRUE;
81}
82
83int
84mediaGetDOS(char *file)
85{
86 char buf[PATH_MAX];
87
88 snprintf(buf, PATH_MAX, "/dos/%s", file);
89 return open(buf, O_RDONLY);
90}
91
92void
93mediaShutdownDOS(Device *dev)
94{
95 if (!DOSMounted)
96 return;
97 msgDebug("Unmounting /dos\n");
98 if (unmount("/dos", 0) != 0)
99 msgConfirm("Could not unmount the DOS partition: %s\n", strerror(errno));
100 msgDebug("Unmount returned\n");
101 DOSMounted = FALSE;
102 return;
103}