121 |
|
void SysAddFloppyPrefs(void) |
122 |
|
{ |
123 |
|
#if defined(__linux__) |
124 |
< |
if (access("/dev/.devfsd", F_OK)) { |
124 |
> |
if (access("/dev/.devfsd", F_OK) < 0) { |
125 |
|
PrefsAddString("floppy", "/dev/fd0u1440"); |
126 |
|
PrefsAddString("floppy", "/dev/fd1u1440"); |
127 |
|
} else { |
130 |
|
struct dirent *floppy_dev; |
131 |
|
while ((floppy_dev = readdir(fd_dir)) != NULL) { |
132 |
|
if (strstr(floppy_dev->d_name, "u1440") != NULL) { |
133 |
< |
char *fd_dev = new char[20]; |
133 |
> |
char fd_dev[20]; |
134 |
|
sprintf(fd_dev, "/dev/floppy/%s", floppy_dev->d_name); |
135 |
|
PrefsAddString("floppy", fd_dev); |
136 |
– |
delete[] fd_dev; |
136 |
|
} |
137 |
|
} |
138 |
|
closedir(fd_dir); |
192 |
|
return; |
193 |
|
|
194 |
|
#if defined(__linux__) |
195 |
< |
if (access("/dev/.devfsd", F_OK)) |
195 |
> |
if (access("/dev/.devfsd", F_OK) < 0) |
196 |
|
PrefsAddString("cdrom", "/dev/cdrom"); |
197 |
|
else { |
198 |
|
DIR *cd_dir = opendir("/dev/cdroms"); |
200 |
|
struct dirent *cdrom_dev; |
201 |
|
while ((cdrom_dev = readdir(cd_dir)) != NULL) { |
202 |
|
if (strcmp(cdrom_dev->d_name, ".") != 0 && strcmp(cdrom_dev->d_name, "..") != 0) { |
203 |
< |
char *cd_dev = new char[20]; |
204 |
< |
strcpy(cd_dev, "/dev/cdroms/%s", cdrom_dev->d_name); |
203 |
> |
char cd_dev[20]; |
204 |
> |
sprintf(cd_dev, "/dev/cdroms/%s", cdrom_dev->d_name); |
205 |
|
PrefsAddString("cdrom", cd_dev); |
207 |
– |
delete[] cd_dev; |
206 |
|
} |
207 |
|
} |
208 |
|
closedir(cd_dir); |
223 |
|
void SysAddSerialPrefs(void) |
224 |
|
{ |
225 |
|
#if defined(__linux__) |
226 |
< |
if (access("/dev/.devfsd", F_OK)) { |
226 |
> |
if (access("/dev/.devfsd", F_OK) < 0) { |
227 |
|
PrefsAddString("seriala", "/dev/ttyS0"); |
228 |
|
PrefsAddString("serialb", "/dev/ttyS1"); |
229 |
|
} else { |