Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
ac1d1056
Commit
ac1d1056
authored
Apr 17, 2003
by
Michal Janusz Miroslaw
Committed by
Alexandre Julliard
Apr 17, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refuse to read non-block device set in config.
Avoid blocking on open if user sets device to unconnected pipe.
parent
0de21b65
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
6 deletions
+27
-6
drive.c
files/drive.c
+27
-6
No files found.
files/drive.c
View file @
ac1d1056
...
@@ -663,17 +663,38 @@ int DRIVE_ReadSuperblock (int drive, char * buff)
...
@@ -663,17 +663,38 @@ int DRIVE_ReadSuperblock (int drive, char * buff)
int
fd
;
int
fd
;
off_t
offs
;
off_t
offs
;
int
ret
=
0
;
int
ret
=
0
;
struct
stat
stat_buf
;
if
(
memset
(
buff
,
0
,
DRIVE_SUPER
)
!=
buff
)
return
-
1
;
if
((
fd
=
open
(
DOSDrives
[
drive
].
device
,
O_RDONLY
))
==
-
1
)
memset
(
buff
,
0
,
DRIVE_SUPER
);
{
/* O_NONBLOCK in case we're opening FIFO; we'll be reset it later */
struct
stat
st
;
if
((
fd
=
open
(
DOSDrives
[
drive
].
device
,
O_RDONLY
|
O_NOCTTY
|
O_NONBLOCK
))
!=
-
1
)
{
if
(
fstat
(
fd
,
&
stat_buf
)
<
0
)
{
/* shouldn't happen since we just opened that file */
ERR
(
"fstat() failed for opened device '%s' (drive %c:) ! IT SHOULDN'T HAPPEN !!!
\n
"
,
DOSDrives
[
drive
].
device
,
'A'
+
drive
);
ret
=
-
1
;
}
else
if
(
!
S_ISBLK
(
stat_buf
.
st_mode
))
{
ERR
(
"Device '%s' (drive %c:) is not a block device - check your config
\n
"
,
DOSDrives
[
drive
].
device
,
'A'
+
drive
);
ret
=
-
1
;
/* reset O_NONBLOCK */
}
else
if
(
fcntl
(
fd
,
F_SETFL
,
0
)
<
0
||
fcntl
(
fd
,
F_GETFL
)
&
O_NONBLOCK
)
{
ERR
(
"fcntl() failed to reset O_NONBLOCK for device '%s' (drive %c:)
\n
"
,
DOSDrives
[
drive
].
device
,
'A'
+
drive
);
ret
=
-
1
;
}
if
(
ret
)
{
close
(
fd
);
fd
=
-
1
;
}
}
else
{
if
(
!
DOSDrives
[
drive
].
device
)
if
(
!
DOSDrives
[
drive
].
device
)
ERR
(
"No device configured for drive %c: !
\n
"
,
'A'
+
drive
);
ERR
(
"No device configured for drive %c: !
\n
"
,
'A'
+
drive
);
else
else
ERR
(
"Couldn't open device '%s' for drive %c: ! (%s)
\n
"
,
DOSDrives
[
drive
].
device
,
'A'
+
drive
,
ERR
(
"Couldn't open device '%s' for drive %c: ! (%s)
\n
"
,
DOSDrives
[
drive
].
device
,
'A'
+
drive
,
(
stat
(
DOSDrives
[
drive
].
device
,
&
st
))
?
(
stat
(
DOSDrives
[
drive
].
device
,
&
stat_buf
))
?
"not available or symlink not valid ?"
:
"no permission"
);
"not available or symlink not valid ?"
:
"no permission"
);
}
if
(
fd
==
-
1
)
{
ERR
(
"Can't read drive volume info ! Either pre-set it or make sure the device to read it from is accessible !
\n
"
);
ERR
(
"Can't read drive volume info ! Either pre-set it or make sure the device to read it from is accessible !
\n
"
);
PROFILE_UsageWineIni
();
PROFILE_UsageWineIni
();
return
-
1
;
return
-
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment