devices.c (161060) | devices.c (161099) |
---|---|
1/* | 1/* |
2 * $FreeBSD: head/usr.sbin/sade/devices.c 161060 2006-08-07 23:35:49Z netchild $ | 2 * $FreeBSD: head/usr.sbin/sade/devices.c 161099 2006-08-08 13:45:46Z delphij $ |
3 * 4 * Copyright (c) 1995 5 * Jordan Hubbard. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright --- 91 unchanged lines hidden (view full) --- 102 return; 103} 104 105static int 106deviceTry(struct _devname dev, char *try, int i) 107{ 108 int fd; 109 char unit[80]; | 3 * 4 * Copyright (c) 1995 5 * Jordan Hubbard. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright --- 91 unchanged lines hidden (view full) --- 102 return; 103} 104 105static int 106deviceTry(struct _devname dev, char *try, int i) 107{ 108 int fd; 109 char unit[80]; |
110 mode_t m; 111 dev_t d; 112 int fail; | |
113 114 snprintf(unit, sizeof unit, dev.name, i); 115 snprintf(try, FILENAME_MAX, "/dev/%s", unit); 116 if (isDebug()) 117 msgDebug("deviceTry: attempting to open %s\n", try); 118 fd = open(try, O_RDONLY); 119 if (fd >= 0) { 120 if (isDebug()) --- 46 unchanged lines hidden (view full) --- 167 } 168 Devices[numDevs = 0] = NULL; 169} 170 171/* Get all device information for devices we have attached */ 172void 173deviceGetAll(void) 174{ | 110 111 snprintf(unit, sizeof unit, dev.name, i); 112 snprintf(try, FILENAME_MAX, "/dev/%s", unit); 113 if (isDebug()) 114 msgDebug("deviceTry: attempting to open %s\n", try); 115 fd = open(try, O_RDONLY); 116 if (fd >= 0) { 117 if (isDebug()) --- 46 unchanged lines hidden (view full) --- 164 } 165 Devices[numDevs = 0] = NULL; 166} 167 168/* Get all device information for devices we have attached */ 169void 170deviceGetAll(void) 171{ |
175 int i, j, fd, s; | 172 int i, j, fd; |
176 char **names; 177 178 msgNotify("Probing devices, please wait (this can take a while)..."); 179 180 /* Next, try to find all the types of devices one might need 181 * during the second stage of the installation. 182 */ 183 for (i = 0; device_names[i].name; i++) { --- 11 unchanged lines hidden (view full) --- 195 } 196 } 197 198 /* Finally, go get the disks and look for DOS partitions to register */ 199 if ((names = Disk_Names()) != NULL) { 200 int i; 201 202 for (i = 0; names[i]; i++) { | 173 char **names; 174 175 msgNotify("Probing devices, please wait (this can take a while)..."); 176 177 /* Next, try to find all the types of devices one might need 178 * during the second stage of the installation. 179 */ 180 for (i = 0; device_names[i].name; i++) { --- 11 unchanged lines hidden (view full) --- 192 } 193 } 194 195 /* Finally, go get the disks and look for DOS partitions to register */ 196 if ((names = Disk_Names()) != NULL) { 197 int i; 198 199 for (i = 0; names[i]; i++) { |
203 Chunk *c1; | |
204 Disk *d; 205 206 /* Ignore memory disks */ 207 if (!strncmp(names[i], "md", 2)) 208 continue; 209 210 /* 211 * XXX --- 138 unchanged lines hidden --- | 200 Disk *d; 201 202 /* Ignore memory disks */ 203 if (!strncmp(names[i], "md", 2)) 204 continue; 205 206 /* 207 * XXX --- 138 unchanged lines hidden --- |