mirror of
https://github.com/open-simh/simh.git
synced 2026-01-13 23:37:13 +00:00
DISK: Properly fail an attempt to access to a non-existent file in raw mode
This commit is contained in:
parent
6667f651a3
commit
8bec55b976
@ -2622,6 +2622,12 @@ if (strchr (openmode, 'r') && (strchr (openmode, '+') || strchr (openmode, 'w'))
|
||||
else
|
||||
if (strchr (openmode, 'r'))
|
||||
mode = O_RDONLY;
|
||||
if (mode == O_RDONLY) {
|
||||
struct stat statb;
|
||||
|
||||
if (stat (rawdevicename, &statb)) /* test for existence/access */
|
||||
return (FILE *)NULL;
|
||||
}
|
||||
#ifdef O_LARGEFILE
|
||||
mode |= O_LARGEFILE;
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user