dos.c (8803) | dos.c (8837) |
---|---|
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 * | 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 $ | 7 * $Id: dos.c,v 1.3 1995/05/28 03:04:54 jkh 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 | 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 bzero(&args, sizeof(args)); |
|
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 | 73 args.fspec = dev->devname; 74 args.uid = args.gid = 0; 75 76 if (mount(MOUNT_MSDOS, "/dos", MNT_RDONLY, (caddr_t)&args) == -1) { 77 msgConfirm("Error mounting %s on /dos: %s (%u)\n", dev, strerror(errno), errno); 78 return FALSE; 79 } 80 DOSMounted = TRUE; 81 return TRUE; 82} 83 84int 85mediaGetDOS(char *file) 86{ 87 char buf[PATH_MAX]; 88 |
88 snprintf(buf, PATH_MAX, "/dos/%s", file); | 89 snprintf(buf, PATH_MAX, "/dos/freebsd/%s", file); 90 if (!access(buf, R_OK)) 91 return open(buf, O_RDONLY); 92 snprintf(buf, PATH_MAX, "/dos/freebsd/dists/%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)); | 93 return open(buf, O_RDONLY); 94} 95 96void 97mediaShutdownDOS(Device *dev) 98{ 99 if (!DOSMounted) 100 return; 101 msgDebug("Unmounting /dos\n"); 102 if (unmount("/dos", 0) != 0) 103 msgConfirm("Could not unmount the DOS partition: %s\n", strerror(errno)); |
100 msgDebug("Unmount returned\n"); | 104 if (isDebug()) 105 msgDebug("Unmount returned\n"); |
101 DOSMounted = FALSE; 102 return; 103} | 106 DOSMounted = FALSE; 107 return; 108} |